Explorar o código

pageSize变化的bug

zhangjie %!s(int64=2) %!d(string=hai) anos
pai
achega
cdff50c706
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      src/modules/grading/marker/MarkerHeader.vue

+ 7 - 1
src/modules/grading/marker/MarkerHeader.vue

@@ -503,7 +503,13 @@ export default {
       this.pageSetChange();
     },
     pageSizeChange(size) {
-      this.setPage({ size });
+      let current = this.page.current;
+      const newTotalPage = Math.ceil(this.page.total / size);
+      if (newTotalPage < current) {
+        current = newTotalPage;
+      }
+
+      this.setPage({ size, current });
       this.pageSetChange();
     },
     pageSetChange() {