Skip to content

Commit

Permalink
fix: pagnitation not work when total change #1989
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Mar 31, 2020
1 parent caa0a64 commit 73fce5f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions components/vc-pagination/Pagination.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 73fce5f

Please sign in to comment.