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()),
internalLayout: computed(() => api.computedInternalLayout()),
totalText: computed(() => api.computedTotalText()),
internalPageSizes: computed(() => props.pageSizes || [10, 20, 30, 40, 50, 100]),
internalPageCount: computed(() => api.computedInternalPageCount()),
showJumperSuffix: designConfig?.state?.showJumperSuffix ?? true,
align: computed(() => props.align || designConfig?.state?.align || 'right'),

View File

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

View File

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