mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 12:07:54 +08:00
fix: pagnitation not work when total change #1989
This commit is contained in:
parent
caa0a6489a
commit
73fce5fc88
@ -120,6 +120,24 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
total() {
|
||||
const newState = {};
|
||||
const newCurrent = calculatePage(this.pageSize, this.$data, this.$props);
|
||||
if (hasProp(this, 'current')) {
|
||||
const current = Math.min(this.current, newCurrent);
|
||||
newState.stateCurrent = current;
|
||||
newState.stateCurrentInputValue = current;
|
||||
} else {
|
||||
let current = this.stateCurrent;
|
||||
if (current === 0 && newCurrent > 0) {
|
||||
current = 1;
|
||||
} else {
|
||||
current = Math.min(this.stateCurrent, newCurrent);
|
||||
}
|
||||
newState.stateCurrent = current;
|
||||
}
|
||||
this.setState(newState);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getJumpPrevPage() {
|
||||
|
Loading…
Reference in New Issue
Block a user