Explorar o código

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

FuryBean %!s(int64=8) %!d(string=hai) anos
pai
achega
6d9df08e56
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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);
       }
     },