Browse Source

fix: avoid rendering options using v-for to function virtual scroll properly

pull/6856/head
Pranav C 1 year ago
parent
commit
0e3f4e7e36
  1. 8
      packages/nc-gui/components/nc/Pagination.vue

8
packages/nc-gui/components/nc/Pagination.vue

@ -42,7 +42,10 @@ const goToFirstPage = () => {
} }
const pagesList = computed(() => { const pagesList = computed(() => {
return Array.from({ length: totalPages.value }, (_, i) => i + 1) return Array.from({ length: totalPages.value }, (_, i) => ({
value: i + 1,
label: i + 1,
}))
}) })
</script> </script>
@ -71,11 +74,10 @@ const pagesList = computed(() => {
<GeneralIcon icon="arrowLeft" /> <GeneralIcon icon="arrowLeft" />
</NcButton> </NcButton>
<div v-if="!isMobileMode" class="text-gray-600"> <div v-if="!isMobileMode" class="text-gray-600">
<a-select v-model:value="current" class="!mr-[2px]" virtual> <a-select v-model:value="current" class="!mr-[2px]" :options="pagesList">
<template #suffixIcon> <template #suffixIcon>
<GeneralIcon icon="arrowDown" class="text-gray-500 nc-select-expand-btn" /> <GeneralIcon icon="arrowDown" class="text-gray-500 nc-select-expand-btn" />
</template> </template>
<a-select-option v-for="p of pagesList" :key="`p-${p}`" @click="changePage({ set: p })">{{ p }}</a-select-option>
</a-select> </a-select>
<span class="mx-1"> {{ mode !== 'full' ? '/' : 'of' }} </span> <span class="mx-1"> {{ mode !== 'full' ? '/' : 'of' }} </span>
<span class="total"> <span class="total">

Loading…
Cancel
Save