lrf 2 år sedan
förälder
incheckning
da031266c6
2 ändrade filer med 11 tillägg och 13 borttagningar
  1. 8 7
      src/components/usual/c-table.vue
  2. 3 6
      src/views/selfShop/goods/index.vue

+ 8 - 7
src/components/usual/c-table.vue

@@ -78,6 +78,7 @@
     <el-row type="flex" align="middle" justify="end" style="padding-top: 1rem" v-if="usePage">
       <el-col :span="24" style="text-align: right">
         <el-pagination
+          v-if="showPageView"
           background
           layout="sizes,total, prev, pager, next"
           :page-sizes="[1, 10, 50, 100, 150, 200]"
@@ -117,8 +118,9 @@ export default {
   data: function () {
     return {
       pageSelected: [],
-      currentPage: 1,
+      currentPage: 0,
       limit: this.$limit,
+      showPageView: true,
     };
   },
   created() {},
@@ -283,20 +285,19 @@ 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.$set(this,'currentPage',currentPage)
-      console.log(JSON.parse(JSON.stringify(this.currentPage)));
+      this.$set(this, 'currentPage', currentPage);
+      this.showPageView = false;
+      setTimeout(() => {
+        this.showPageView = true;
+      }, 1000);
     },
   },
 };

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

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