保誠-保戶業務員媒合平台
Mila
2021-12-29 cc663139f6abd63f7deac4739b63db754baf595c
PAMapp/components/Ui/UiPagination.vue
@@ -1,6 +1,6 @@
<template>
    <el-pagination
        :current-page.sync="currentPage"
        :current-page.sync="syncCurrentPage"
        layout="prev, pager, next"
        :total="totalList.length"
        :page-size="pageSize"
@@ -11,7 +11,7 @@
</template>
<script lang="ts">
import { Vue, Component, Prop, Emit, Watch } from 'nuxt-property-decorator';
import { Vue, Component, Prop, Emit, Watch, PropSync } from 'nuxt-property-decorator';
import { Consultant } from '~/shared/models/consultant.model';
@Component
@@ -20,7 +20,7 @@
    totalList!: Consultant[];
    @Prop({default: 5}) pageSize!: number;
    currentPage = 1;
    @PropSync('currentPage', {default: 1}) syncCurrentPage!: number;
    pageList: Consultant[] = [];
@@ -34,14 +34,14 @@
    @Watch('totalList')
    watchTotalList(newValue: Consultant[]) {
        if (newValue) {
            this.handleCurrentChange(this.currentPage);
            this.handleCurrentChange(this.syncCurrentPage);
        }
    }
    //////////////////////////////////////////////////////////////////
    mounted() {
        this.handleCurrentChange(this.currentPage);
        this.handleCurrentChange(this.syncCurrentPage);
    }
    //////////////////////////////////////////////////////////////////