fix(pager): fix init pager-size error when not match page-sizes (#3566)
This commit is contained in:
parent
bb72b19e6a
commit
1034ef5a9f
|
@ -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'),
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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)"
|
||||||
|
|
Loading…
Reference in New Issue