Explorar o código

refactor: remove some unnecessary configurations of Pagination

Casper Dai %!s(int64=3) %!d(string=hai) anos
pai
achega
1e6d7b88f8

+ 0 - 5
src/components/table/CTable/index.vue

@@ -26,7 +26,6 @@
     <pagination
       v-if="options.params"
       :total="options.totalCount"
-      :page-sizes="pageSizes"
       :page.sync="options.params.pageNum"
       :limit.sync="options.params.pageSize"
       @pagination="onPagination"
@@ -44,10 +43,6 @@ export default {
         return {}
       }
     },
-    pageSizes: {
-      type: Array,
-      default: void 0
-    },
     copy: {
       type: [Boolean, String],
       default: false

+ 0 - 1
src/components/table/GridTable/index.vue

@@ -80,7 +80,6 @@
       />
       <pagination
         :total="options.totalCount"
-        :page-sizes="[8, 16, 32]"
         :page.sync="options.params.pageNum"
         :limit.sync="options.params.pageSize"
         @pagination="onPagination"

+ 4 - 32
src/components/table/Pagination/index.vue

@@ -2,15 +2,13 @@
   <div class="l-flex__none c-pagination">
     <el-pagination
       :current-page.sync="currentPage"
-      :page-size.sync="pageSize"
-      :page-sizes="pageSizes"
+      :page-size="limit"
       :pager-count="5"
       :total="Number(total)"
-      :layout="layout"
-      :background="background"
+      layout="total,prev,pager,next,jumper"
+      background
       hide-on-single-page
       v-bind="$attrs"
-      @size-change="onSizeChange"
       @current-change="onCurrentChange"
     />
   </div>
@@ -31,21 +29,6 @@ export default {
     limit: {
       type: Number,
       default: 20
-    },
-    pageSizes: {
-      type: Array,
-      default () {
-        return [10, 20, 50]
-      }
-    },
-    layout: {
-      type: String,
-      // sizes
-      default: 'total, prev, pager, next, jumper'
-    },
-    background: {
-      type: [Boolean, String],
-      default: true
     }
   },
   computed: {
@@ -56,22 +39,11 @@ export default {
       set (val) {
         this.$emit('update:page', val)
       }
-    },
-    pageSize: {
-      get () {
-        return this.limit
-      },
-      set (val) {
-        this.$emit('update:limit', val)
-      }
     }
   },
   methods: {
-    onSizeChange (val) {
-      this.$emit('pagination', { page: this.currentPage, limit: val })
-    },
     onCurrentChange (val) {
-      this.$emit('pagination', { page: val, limit: this.pageSize })
+      this.$emit('pagination', { page: val, limit: this.limit })
     }
   }
 }