YY пре 2 година
родитељ
комит
980d2da6a8
2 измењених фајлова са 16 додато и 4 уклоњено
  1. 6 1
      src/components/usual/c-table.vue
  2. 10 3
      src/views/selfShop/goods/index.vue

+ 6 - 1
src/components/usual/c-table.vue

@@ -283,15 +283,20 @@ export default {
     },
 
     resetPage() {
+      console.log('in 1')
       this.currentPage = 1;
       this.skip = 0;
     },
     getPageConfig() {
+      console.log('in 2')
       return { skip: (this.currentPage - 1) * this.limit, limit: this.limit, currentPage: this.currentPage };
     },
     setPage({ skip, limit }) {
+      console.log('in 3')
       let currentPage = skip / limit + 1;
-      this.currentPage = currentPage;
+      // this.currentPage = currentPage;
+      this.$set(this,'currentPage',currentPage)
+      console.log(JSON.parse(JSON.stringify(this.currentPage)));
     },
   },
 };

+ 10 - 3
src/views/selfShop/goods/index.vue

@@ -177,11 +177,18 @@ export default {
       searchQuery: {},
     };
   },
-  created() {
+  mounted() {
     this.searchOthers();
     let route = JSON.parse(sessionStorage.getItem(this.$route.path));
-    if (route) this.search(route);
-    else this.search();
+    if (route) {
+      this.search(route);
+      // this.$nextTick(() => {
+        this.$refs.dataTable.setPage(route);
+      this.$forceUpdate()
+
+      //   console.log('1');
+      // });
+    } else this.search();
   },
 
   methods: {