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