| | |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop, Emit, Watch } from 'nuxt-property-decorator'; |
| | | import { Agents } from '~/plugins/api/home'; |
| | | import { Consultants } from '~/assets/ts/api/consultant'; |
| | | |
| | | @Component |
| | | export default class UiPagination extends Vue { |
| | | @Prop() totalList!: Agents[]; |
| | | @Prop() totalList!: Consultants[]; |
| | | pageSize = 5; |
| | | currentPage = 1; |
| | | pageList: Agents[] = []; |
| | | pageList: Consultants[] = []; |
| | | |
| | | mounted() { |
| | | this.handleCurrentChange(this.currentPage); |
| | | } |
| | | |
| | | @Emit('changePage') chagnePage(): Agents[] { |
| | | @Emit('changePage') chagnePage(): Consultants[] { |
| | | return this.pageList |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Watch('totalList') watchtotalList(newValue: Agents[]) { |
| | | @Watch('totalList') watchtotalList(newValue: Consultants[]) { |
| | | if (newValue) { |
| | | this.handleCurrentChange(this.currentPage); |
| | | } |