fix(pager): fix init pager-size error when not match page-sizes (#3566)

This commit is contained in:
gimmyhehe 2025-07-10 20:26:46 +08:00 committed by GitHub
parent bb72b19e6a
commit 1034ef5a9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -91,6 +91,7 @@ export const renderless = (
showPager: computed(() => api.computedShowPager()), showPager: computed(() => api.computedShowPager()),
internalLayout: computed(() => api.computedInternalLayout()), internalLayout: computed(() => api.computedInternalLayout()),
totalText: computed(() => api.computedTotalText()), totalText: computed(() => api.computedTotalText()),
internalPageSizes: computed(() => props.pageSizes || [10, 20, 30, 40, 50, 100]),
internalPageCount: computed(() => api.computedInternalPageCount()), internalPageCount: computed(() => api.computedInternalPageCount()),
showJumperSuffix: designConfig?.state?.showJumperSuffix ?? true, showJumperSuffix: designConfig?.state?.showJumperSuffix ?? true,
align: computed(() => props.align || designConfig?.state?.align || 'right'), align: computed(() => props.align || designConfig?.state?.align || 'right'),

View File

@ -34,8 +34,7 @@ export const pagerProps = {
type: String type: String
}, },
pageSizes: { pageSizes: {
type: Array as PropType<number[]>, type: Array as PropType<number[]>
default: () => [10, 20, 30, 40, 50, 100]
}, },
pagerCount: { pagerCount: {
type: Number, type: Number,

View File

@ -123,7 +123,7 @@
<div class="tiny-pager__selector-body"> <div class="tiny-pager__selector-body">
<ul class="tiny-pager__selector-poplist"> <ul class="tiny-pager__selector-poplist">
<li <li
v-for="(sizeItem, sizeIndex) in pageSizes" v-for="(sizeItem, sizeIndex) in state.internalPageSizes"
:key="sizeIndex" :key="sizeIndex"
:class="['list-item', sizeItem === state.internalPageSize ? 'is-selected select-pre' : '']" :class="['list-item', sizeItem === state.internalPageSize ? 'is-selected select-pre' : '']"
:title="String(sizeItem)" :title="String(sizeItem)"