mirror of https://github.com/ElemeFE/element
Pagination: fix current-change not fire after currentPage manually updated (#10562)
parent
af0c89912f
commit
94312a4444
|
@ -299,6 +299,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.internalCurrentPage = this.getValidCurrentPage(val);
|
this.internalCurrentPage = this.getValidCurrentPage(val);
|
||||||
|
this.userChangePageSize = true;
|
||||||
this.emitChange();
|
this.emitChange();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -343,9 +344,10 @@ export default {
|
||||||
|
|
||||||
emitChange() {
|
emitChange() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.internalCurrentPage !== this.lastEmittedPage) {
|
if (this.internalCurrentPage !== this.lastEmittedPage || this.userChangePageSize) {
|
||||||
this.$emit('current-change', this.internalCurrentPage);
|
this.$emit('current-change', this.internalCurrentPage);
|
||||||
this.lastEmittedPage = this.internalCurrentPage;
|
this.lastEmittedPage = this.internalCurrentPage;
|
||||||
|
this.userChangePageSize = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue