소스 검색

Pagination: fix currentPage may be 0 in some condition. (#943)

FuryBean 8 년 전
부모
커밋
6d9df08e56
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      packages/pagination/src/pagination.js

+ 2 - 2
packages/pagination/src/pagination.js

@@ -293,8 +293,8 @@ export default {
         this.internalCurrentPage = 1;
         this.$emit('current-change', 1);
       } else if (this.internalCurrentPage > newVal) {
-        this.internalCurrentPage = newVal;
-        this.$emit('current-change', newVal);
+        this.internalCurrentPage = newVal === 0 ? 1 : newVal;
+        this.$emit('current-change', this.internalCurrentPage);
       }
     },