From 51b6cf960861e16c05cfd74d8bb78548fe82cc5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Tue, 30 Aug 2022 16:36:10 +0900 Subject: [PATCH] =?UTF-8?q?Vue2=5FFrontend=20=EC=88=98=EC=A0=951...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/todo/ListComponent.vue | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/components/todo/ListComponent.vue b/src/components/todo/ListComponent.vue index 2413e5e..7c0af7f 100644 --- a/src/components/todo/ListComponent.vue +++ b/src/components/todo/ListComponent.vue @@ -82,7 +82,7 @@ @@ -118,7 +118,6 @@ - @@ -234,11 +229,11 @@ export default { setup: function () {}, created: function () {}, mounted: function () { - this.getDatas() + this.getDatas(1) }, unmounted() {}, methods: { - async getDatas() { + async getDatas(page) { this.isBusy = true const results = await this.callAPI('/todo', { params: { @@ -246,7 +241,7 @@ export default { sortDirection: this.sortDirection, searchFields: this.searchFields, search: this.search, - page: this.currentPage, + page: page, perPage: this.perPage } }) @@ -259,20 +254,18 @@ export default { this.isBusy = false }, searchClick() { - this.currentPage = 1 - this.getDatas() + this.getDatas(1) }, pageClick(bvEvent, page) { console.log(bvEvent) - this.currentPage = page - this.getDatas() - bvEvent.preventDefault() + // this.currentPage = page + this.getDatas(page) + // bvEvent.preventDefault() }, perPageClick(perPage) { - this.currentPage = 1 this.perPage = perPage console.log(this.perPage) - this.getDatas() + this.getDatas(1) }, busyToggle() { this.isBusy = !this.isBusy