Explorar el Código

Pagination: update pager value when page size changes (#10157)

杨奕 hace 7 años
padre
commit
5797325c73
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      packages/pagination/src/pagination.js

+ 8 - 0
packages/pagination/src/pagination.js

@@ -211,6 +211,14 @@ export default {
 
       components: { ElInput },
 
+      watch: {
+        '$parent.internalPageSize'() {
+          this.$nextTick(() => {
+            this.$refs.input.$el.querySelector('input').value = this.$parent.internalCurrentPage;
+          });
+        }
+      },
+
       methods: {
         handleFocus(event) {
           this.oldValue = event.target.value;