Pagination: fix current-change not fire after currentPage manually updated (#10562)

pull/10565/head
杨奕 2018-04-04 19:26:38 +08:00 committed by GitHub
parent af0c89912f
commit 94312a4444
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -299,6 +299,7 @@ export default {
methods: {
handleCurrentChange(val) {
this.internalCurrentPage = this.getValidCurrentPage(val);
this.userChangePageSize = true;
this.emitChange();
},
@ -343,9 +344,10 @@ export default {
emitChange() {
this.$nextTick(() => {
if (this.internalCurrentPage !== this.lastEmittedPage) {
if (this.internalCurrentPage !== this.lastEmittedPage || this.userChangePageSize) {
this.$emit('current-change', this.internalCurrentPage);
this.lastEmittedPage = this.internalCurrentPage;
this.userChangePageSize = false;
}
});
}