Browse Source

fix(nc-gui): update NcPagination page size logic

pull/8836/head
Ramesh Mane 5 months ago
parent
commit
ab21279e79
  1. 14
      packages/nc-gui/components/nc/Pagination.vue

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

@ -1,7 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import NcTooltip from '~/components/nc/Tooltip.vue' import NcTooltip from '~/components/nc/Tooltip.vue'
const props = defineProps<{ const props = withDefaults(
defineProps<{
current: number current: number
total: number total: number
pageSize: number pageSize: number
@ -12,11 +13,16 @@ const props = defineProps<{
firstPageTooltip?: string firstPageTooltip?: string
lastPageTooltip?: string lastPageTooltip?: string
showSizeChanger?: boolean showSizeChanger?: boolean
}>() useStoredPageSize?: boolean
}>(),
{
useStoredPageSize: true,
},
)
const emits = defineEmits(['update:current', 'update:pageSize']) const emits = defineEmits(['update:current', 'update:pageSize'])
const { total, showSizeChanger } = toRefs(props) const { total, showSizeChanger, useStoredPageSize } = toRefs(props)
const current = useVModel(props, 'current', emits) const current = useVModel(props, 'current', emits)
@ -26,7 +32,7 @@ const { gridViewPageSize, setGridViewPageSize } = useGlobal()
const localPageSize = computed({ const localPageSize = computed({
get: () => { get: () => {
if (!showSizeChanger.value) return pageSize.value if (!showSizeChanger.value || (showSizeChanger.value && !useStoredPageSize.value)) return pageSize.value
const storedPageSize = gridViewPageSize.value || 25 const storedPageSize = gridViewPageSize.value || 25

Loading…
Cancel
Save