From 7c9f9647fbc4ebb671cb297743b21322eda0fde3 Mon Sep 17 00:00:00 2001 From: Mila <Mila@pollex.com.tw> Date: 星期四, 04 十一月 2021 14:08:00 +0800 Subject: [PATCH] TODO#129071 顧問-客戶預約 畫面刻版 --- PAMapp/components/Ui/UiPagination.vue | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/PAMapp/components/Ui/UiPagination.vue b/PAMapp/components/Ui/UiPagination.vue index b2128a7..0229097 100644 --- a/PAMapp/components/Ui/UiPagination.vue +++ b/PAMapp/components/Ui/UiPagination.vue @@ -1,9 +1,11 @@ <template> <el-pagination + :current-page.sync="currentPage" layout="prev, pager, next" :total="totalList.length" :page-size="pageSize" @current-change="handleCurrentChange" + class="mt-10" > </el-pagination> </template> @@ -28,6 +30,11 @@ } handleCurrentChange(currentPage: number) { + + if (this.totalList.length <= this.pageSize && currentPage !== 1) { + currentPage -= 1; + } + if (this.totalList) { this.pageList = this.totalList.slice(this.pageSize * currentPage - this.pageSize, this.pageSize * currentPage) this.chagnePage(); -- Gitblit v1.8.0