From e21b3a91e6e3324771d518e098efdeb989c0bf4c Mon Sep 17 00:00:00 2001 From: miaojiale <1123971748@qq.com> Date: Fri, 7 Apr 2023 17:19:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TabComponents/mixin.js | 39 ++++++++++++++------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/components/TabComponents/mixin.js b/src/components/TabComponents/mixin.js index f09c8b3..94fcf63 100644 --- a/src/components/TabComponents/mixin.js +++ b/src/components/TabComponents/mixin.js @@ -1,24 +1,25 @@ const mixin = { - data() { - return { - total: 0, - pageIndex: 1, - pageSize: 10, - pageSizes: [10, 20, 50, 100] - } + data() { + return { + total: 0, + pageIndex: 1, + pageSize: 10, + pageSizes: [10, 20, 50, 100], + } + }, + methods: { + // 跳转页码 + handleCurrentChange(val) { + this.pageIndex = val + this.handleSearch() }, - methods: { - // 跳转页码 - handleCurrentChange(val) { - this.pageIndex = val - this.handleSearch() - }, - // 切换页面显示条数 - handleSizeChange(val) { - this.pageSize = val - this.handleSearch() - } - } + // 切换页面显示条数 + handleSizeChange(val) { + this.pageIndex = 1 + this.pageSize = val + this.handleSearch() + }, + }, } export default mixin -- 2.22.0