소스 검색

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

杨奕 7 년 전
부모
커밋
94312a4444
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      packages/pagination/src/pagination.js

+ 3 - 1
packages/pagination/src/pagination.js

@@ -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;
         }
       });
     }