保誠-保戶業務員媒合平台
HelenHuang
2021-11-05 cf6803cd4f2c535afb1eaa935fd9e9735279656b
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();