Browse Source

修改框架,没啥大改

lrf402788946 5 years ago
parent
commit
1dced54e2f
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/layout/admin/list-frame.vue

+ 5 - 4
src/layout/admin/list-frame.vue

@@ -25,7 +25,7 @@
           <el-pagination
             background
             layout="total, prev, pager, next"
-            :total="totalRow"
+            :total="total"
             :page-size="limit"
             :current-page.sync="currentPage"
             @current-change="changePage"
@@ -42,20 +42,21 @@ import _ from 'lodash';
 export default {
   name: 'list-frame',
   props: {
-    totalRow: { type: Number, default: 0 },
+    total: { type: Number, default: 0 },
     needPag: { type: Boolean, default: true },
     returns: { type: null, default: null },
   },
   components: {},
   data: () => ({
-    limit: _.get(this, `$limit`, undefined) !== undefined ? this.$limit : 15,
+    limit: _.get(this, `$limit`, undefined) !== undefined ? this.$limit : 10,
     currentPage: 1,
   }),
   created() {},
   computed: {},
   methods: {
     changePage(page) {
-      this.$emit('changePage', page);
+      let skip = (page - 1) * this.limit;
+      this.$emit('query', { skip: skip, limit: this.limit });
     },
   },
 };