mirror of
https://github.com/rommapp/romm.git
synced 2026-12-03 10:33:22 +01:00
wrap galleries in v-virtual-scroll
This commit is contained in:
@@ -242,46 +242,50 @@ onBeforeUnmount(() => {
|
||||
<template v-if="filteredRoms.length > 0">
|
||||
<v-row v-if="currentView != 2" class="mx-1 my-3 mr-14" no-gutters>
|
||||
<!-- Gallery cards view -->
|
||||
<!-- v-show instead of v-if to avoid recalculate on view change -->
|
||||
<v-col
|
||||
v-for="rom in filteredRoms"
|
||||
:key="rom.id"
|
||||
class="pa-1 align-self-end"
|
||||
:cols="views[currentView]['size-cols']"
|
||||
:sm="views[currentView]['size-sm']"
|
||||
:md="views[currentView]['size-md']"
|
||||
:lg="views[currentView]['size-lg']"
|
||||
:xl="views[currentView]['size-xl']"
|
||||
:style="{
|
||||
zIndex:
|
||||
(isHovering && hoveringRomId === rom.id) ||
|
||||
(openedMenu && openedMenuRomId === rom.id)
|
||||
? 1100
|
||||
: 1,
|
||||
}"
|
||||
<v-virtual-scroll
|
||||
:items="filteredRoms"
|
||||
:item-key="(item) => item.id"
|
||||
renderless
|
||||
>
|
||||
<game-card
|
||||
:key="rom.updated_at"
|
||||
:rom="rom"
|
||||
titleOnHover
|
||||
pointerOnHover
|
||||
withLink
|
||||
transformScale
|
||||
showActionBar
|
||||
showChips
|
||||
:withBorderPrimary="
|
||||
romsStore.isSimpleRom(rom) && selectedRoms?.includes(rom)
|
||||
"
|
||||
:sizeActionBar="currentView"
|
||||
:enable3DTilt="enable3DEffect"
|
||||
@click="onGameClick"
|
||||
@touchstart="onGameTouchStart"
|
||||
@touchend="onGameTouchEnd"
|
||||
@hover="onHover"
|
||||
@openedmenu="onOpenedMenu"
|
||||
@closedmenu="onClosedMenu"
|
||||
/>
|
||||
</v-col>
|
||||
<template #default="{ item }">
|
||||
<v-col
|
||||
:key="item.id"
|
||||
class="pa-1 align-self-end"
|
||||
:cols="views[currentView]['size-cols']"
|
||||
:sm="views[currentView]['size-sm']"
|
||||
:md="views[currentView]['size-md']"
|
||||
:lg="views[currentView]['size-lg']"
|
||||
:xl="views[currentView]['size-xl']"
|
||||
:style="{
|
||||
zIndex:
|
||||
(isHovering && hoveringRomId === item.id) ||
|
||||
(openedMenu && openedMenuRomId === item.id)
|
||||
? 1100
|
||||
: 1,
|
||||
}"
|
||||
>
|
||||
<game-card
|
||||
:key="item.updated_at"
|
||||
:rom="item"
|
||||
titleOnHover
|
||||
pointerOnHover
|
||||
withLink
|
||||
transformScale
|
||||
showActionBar
|
||||
showChips
|
||||
:withBorderPrimary="selectedRoms?.includes(item)"
|
||||
:sizeActionBar="currentView"
|
||||
:enable3DTilt="enable3DEffect"
|
||||
@click="onGameClick"
|
||||
@touchstart="onGameTouchStart"
|
||||
@touchend="onGameTouchEnd"
|
||||
@hover="onHover"
|
||||
@openedmenu="onOpenedMenu"
|
||||
@closedmenu="onClosedMenu"
|
||||
/>
|
||||
</v-col>
|
||||
</template>
|
||||
</v-virtual-scroll>
|
||||
</v-row>
|
||||
|
||||
<!-- Gallery list view -->
|
||||
|
||||
@@ -245,47 +245,55 @@ onBeforeUnmount(() => {
|
||||
<template v-if="filteredRoms.length > 0">
|
||||
<v-row v-if="currentView != 2" class="mx-1 my-3 mr-14" no-gutters>
|
||||
<!-- Gallery cards view -->
|
||||
<v-col
|
||||
v-for="rom in filteredRoms"
|
||||
:key="rom.id"
|
||||
class="pa-1 align-self-end"
|
||||
:cols="views[currentView]['size-cols']"
|
||||
:sm="views[currentView]['size-sm']"
|
||||
:md="views[currentView]['size-md']"
|
||||
:lg="views[currentView]['size-lg']"
|
||||
:xl="views[currentView]['size-xl']"
|
||||
:style="{
|
||||
zIndex:
|
||||
(isHovering && hoveringRomId === rom.id) ||
|
||||
(openedMenu && openedMenuRomId === rom.id)
|
||||
? 1100
|
||||
: 1,
|
||||
}"
|
||||
<v-virtual-scroll
|
||||
:items="filteredRoms"
|
||||
:item-key="(item) => item.id"
|
||||
renderless
|
||||
>
|
||||
<game-card
|
||||
v-if="currentPlatform"
|
||||
:key="rom.updated_at"
|
||||
:rom="rom"
|
||||
titleOnHover
|
||||
pointerOnHover
|
||||
withLink
|
||||
transformScale
|
||||
showActionBar
|
||||
showChips
|
||||
:showPlatformIcon="false"
|
||||
:withBorderPrimary="
|
||||
romsStore.isSimpleRom(rom) && selectedRoms?.includes(rom)
|
||||
"
|
||||
:sizeActionBar="currentView"
|
||||
:enable3DTilt="enable3DEffect"
|
||||
@click="onGameClick"
|
||||
@touchstart="onGameTouchStart"
|
||||
@touchend="onGameTouchEnd"
|
||||
@hover="onHover"
|
||||
@openedmenu="onOpenedMenu"
|
||||
@closedmenu="onClosedMenu"
|
||||
/>
|
||||
</v-col>
|
||||
<template #default="{ item }">
|
||||
<v-col
|
||||
v-for="rom in filteredRoms"
|
||||
:key="rom.id"
|
||||
class="pa-1 align-self-end"
|
||||
:cols="views[currentView]['size-cols']"
|
||||
:sm="views[currentView]['size-sm']"
|
||||
:md="views[currentView]['size-md']"
|
||||
:lg="views[currentView]['size-lg']"
|
||||
:xl="views[currentView]['size-xl']"
|
||||
:style="{
|
||||
zIndex:
|
||||
(isHovering && hoveringRomId === rom.id) ||
|
||||
(openedMenu && openedMenuRomId === rom.id)
|
||||
? 1100
|
||||
: 1,
|
||||
}"
|
||||
>
|
||||
<game-card
|
||||
v-if="currentPlatform"
|
||||
:key="rom.updated_at"
|
||||
:rom="rom"
|
||||
titleOnHover
|
||||
pointerOnHover
|
||||
withLink
|
||||
transformScale
|
||||
showActionBar
|
||||
showChips
|
||||
:showPlatformIcon="false"
|
||||
:withBorderPrimary="
|
||||
romsStore.isSimpleRom(rom) && selectedRoms?.includes(rom)
|
||||
"
|
||||
:sizeActionBar="currentView"
|
||||
:enable3DTilt="enable3DEffect"
|
||||
@click="onGameClick"
|
||||
@touchstart="onGameTouchStart"
|
||||
@touchend="onGameTouchEnd"
|
||||
@hover="onHover"
|
||||
@openedmenu="onOpenedMenu"
|
||||
@closedmenu="onClosedMenu"
|
||||
/>
|
||||
</v-col>
|
||||
</template>
|
||||
</v-virtual-scroll>
|
||||
</v-row>
|
||||
|
||||
<!-- Gallery list view -->
|
||||
|
||||
@@ -153,46 +153,53 @@ onBeforeUnmount(() => {
|
||||
<template v-else>
|
||||
<template v-if="filteredRoms.length > 0">
|
||||
<v-row v-if="currentView != 2" class="mx-1 my-3 mr-14" no-gutters>
|
||||
<!-- Gallery cards view -->
|
||||
<v-col
|
||||
v-for="rom in filteredRoms"
|
||||
:key="rom.id"
|
||||
class="pa-1 align-self-end"
|
||||
:cols="views[currentView]['size-cols']"
|
||||
:sm="views[currentView]['size-sm']"
|
||||
:md="views[currentView]['size-md']"
|
||||
:lg="views[currentView]['size-lg']"
|
||||
:xl="views[currentView]['size-xl']"
|
||||
:style="{
|
||||
zIndex:
|
||||
(isHovering && hoveringRomId === rom.id) ||
|
||||
(openedMenu && openedMenuRomId === rom.id)
|
||||
? 1100
|
||||
: 1,
|
||||
}"
|
||||
<v-virtual-scroll
|
||||
:items="filteredRoms"
|
||||
:item-key="(item) => item.id"
|
||||
renderless
|
||||
>
|
||||
<game-card
|
||||
:key="rom.updated_at"
|
||||
:rom="rom"
|
||||
titleOnHover
|
||||
pointerOnHover
|
||||
withLink
|
||||
transformScale
|
||||
showActionBar
|
||||
showChips
|
||||
:withBorderPrimary="
|
||||
romsStore.isSimpleRom(rom) && selectedRoms?.includes(rom)
|
||||
"
|
||||
:enable3DTilt="enable3DEffect"
|
||||
:sizeActionBar="currentView"
|
||||
@click="onGameClick"
|
||||
@touchstart="onGameTouchStart"
|
||||
@touchend="onGameTouchEnd"
|
||||
@hover="onHover"
|
||||
@openedmenu="onOpenedMenu"
|
||||
@closedmenu="onClosedMenu"
|
||||
/>
|
||||
</v-col>
|
||||
<template #default="{ item }">
|
||||
<v-col
|
||||
v-for="rom in filteredRoms"
|
||||
:key="rom.id"
|
||||
class="pa-1 align-self-end"
|
||||
:cols="views[currentView]['size-cols']"
|
||||
:sm="views[currentView]['size-sm']"
|
||||
:md="views[currentView]['size-md']"
|
||||
:lg="views[currentView]['size-lg']"
|
||||
:xl="views[currentView]['size-xl']"
|
||||
:style="{
|
||||
zIndex:
|
||||
(isHovering && hoveringRomId === rom.id) ||
|
||||
(openedMenu && openedMenuRomId === rom.id)
|
||||
? 1100
|
||||
: 1,
|
||||
}"
|
||||
>
|
||||
<game-card
|
||||
:key="rom.updated_at"
|
||||
:rom="rom"
|
||||
titleOnHover
|
||||
pointerOnHover
|
||||
withLink
|
||||
transformScale
|
||||
showActionBar
|
||||
showChips
|
||||
:withBorderPrimary="
|
||||
romsStore.isSimpleRom(rom) && selectedRoms?.includes(rom)
|
||||
"
|
||||
:enable3DTilt="enable3DEffect"
|
||||
:sizeActionBar="currentView"
|
||||
@click="onGameClick"
|
||||
@touchstart="onGameTouchStart"
|
||||
@touchend="onGameTouchEnd"
|
||||
@hover="onHover"
|
||||
@openedmenu="onOpenedMenu"
|
||||
@closedmenu="onClosedMenu"
|
||||
/>
|
||||
</v-col>
|
||||
</template>
|
||||
</v-virtual-scroll>
|
||||
</v-row>
|
||||
|
||||
<!-- Gallery list view -->
|
||||
|
||||
Reference in New Issue
Block a user