保誠-保戶業務員媒合平台
Mila
2021-11-04 7c9f9647fbc4ebb671cb297743b21322eda0fde3
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();