mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 20:27:44 +08:00
fix(pagination): fix pagination known issues (#811)
* fix(pagination): fix pagination known issues - Fix pagination emitting current change twice * fix(pagination): add defaults for readability * fix(pagination): - remove defaults
This commit is contained in:
parent
ab76b845f5
commit
6bc5a5ee5a
@ -72,6 +72,7 @@ describe('Pagination.vue', () => {
|
||||
props: {
|
||||
pageSize: 25,
|
||||
pagerCount: 5,
|
||||
pageCount: 50,
|
||||
},
|
||||
})
|
||||
expect(wrapper.findAll('li.number').length).toBe(5)
|
||||
|
@ -39,12 +39,10 @@ export default defineComponent({
|
||||
|
||||
total: {
|
||||
type: Number,
|
||||
default: 1000,
|
||||
},
|
||||
|
||||
pageCount: {
|
||||
type: Number,
|
||||
default: 50,
|
||||
},
|
||||
|
||||
pagerCount: {
|
||||
@ -124,9 +122,8 @@ export default defineComponent({
|
||||
nextTick(() => {
|
||||
if (
|
||||
internalCurrentPage.value !== lastEmittedPage.value ||
|
||||
userChangePageSize
|
||||
userChangePageSize.value
|
||||
) {
|
||||
emit('current-change', internalCurrentPage.value)
|
||||
lastEmittedPage.value = internalCurrentPage.value
|
||||
userChangePageSize.value = false
|
||||
}
|
||||
@ -136,7 +133,6 @@ export default defineComponent({
|
||||
function handleCurrentChange(val: number) {
|
||||
internalCurrentPage.value = getValidCurrentPage(val)
|
||||
userChangePageSize.value = true
|
||||
emitChange()
|
||||
}
|
||||
|
||||
function handleSizesChange(val: number) {
|
||||
|
@ -57,7 +57,6 @@ export default defineComponent({
|
||||
},
|
||||
pageCount: {
|
||||
type: Number,
|
||||
default: 50,
|
||||
},
|
||||
pagerCount: {
|
||||
type: Number,
|
||||
|
Loading…
Reference in New Issue
Block a user