From abfd26bb700d93a92da6a04703b0187d4acaaeb5 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期三, 22 十二月 2021 10:13:02 +0800 Subject: [PATCH] refactor: move ts folder to shared folder --- PAMapp/components/Ui/UiPagination.vue | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PAMapp/components/Ui/UiPagination.vue b/PAMapp/components/Ui/UiPagination.vue index 0229097..abb27a9 100644 --- a/PAMapp/components/Ui/UiPagination.vue +++ b/PAMapp/components/Ui/UiPagination.vue @@ -12,20 +12,20 @@ <script lang="ts"> import { Vue, Component, Prop, Emit, Watch } from 'nuxt-property-decorator'; -import { Agents } from '~/plugins/api/home'; +import { Consultant } from '~/shared/models/consultant.model'; @Component export default class UiPagination extends Vue { - @Prop() totalList!: Agents[]; - pageSize = 5; + @Prop() totalList!: Consultant[]; + @Prop({default: 5}) pageSize!: number; currentPage = 1; - pageList: Agents[] = []; + pageList: Consultant[] = []; mounted() { this.handleCurrentChange(this.currentPage); } - @Emit('changePage') chagnePage(): Agents[] { + @Emit('changePage') changePage(): Consultant[] { return this.pageList } @@ -37,14 +37,14 @@ if (this.totalList) { this.pageList = this.totalList.slice(this.pageSize * currentPage - this.pageSize, this.pageSize * currentPage) - this.chagnePage(); + this.changePage(); } } - @Watch('totalList') watchtotalList(newValue: Agents[]) { + @Watch('totalList') watchTotalList(newValue: Consultant[]) { if (newValue) { this.handleCurrentChange(this.currentPage); } } } -</script> \ No newline at end of file +</script> -- Gitblit v1.8.0