Compare commits

..

No commits in common. "51b6cf960861e16c05cfd74d8bb78548fe82cc5d" and "409ad853563d1550d00379405e17671b7ca76d84" have entirely different histories.

View File

@ -82,7 +82,7 @@
<!-- Row의 Index를 이용한 번호 출력 --> <!-- Row의 Index를 이용한 번호 출력 -->
<template #cell(id)="row"> <template #cell(id)="row">
<b-link ref="edit/{{row.item.id}}"> <b-link ref="edit/{{row.item.id}}">
{{ total - (currentPage * perPage + row.index) + perPage }} : {{ total - (currentPage * perPage + row.index) + perPage }}
</b-link> </b-link>
</template> </template>
<!-- 제목부분 출력용 --> <!-- 제목부분 출력용 -->
@ -117,15 +117,17 @@
<p>{{ selectedRows }}</p> <p>{{ selectedRows }}</p>
</b-col> </b-col>
<b-col> <b-col>
<template>
<b-pagination <b-pagination
v-model="currentPage"
:total-rows="total" :total-rows="total"
:per-page="perPage" :per-page="perPage"
@page-click="pageClick" @page-click="pageClick"
last-number
aria-controls="todoTable" aria-controls="todoTable"
size="lg"
class="justify-content-center" class="justify-content-center"
> ></b-pagination>
</b-pagination> </template>
</b-col> </b-col>
<b-col> <b-col>
<b-input-group class="justify-content-end"> <b-input-group class="justify-content-end">
@ -229,11 +231,11 @@ export default {
setup: function () {}, setup: function () {},
created: function () {}, created: function () {},
mounted: function () { mounted: function () {
this.getDatas(1) this.getDatas()
}, },
unmounted() {}, unmounted() {},
methods: { methods: {
async getDatas(page) { async getDatas() {
this.isBusy = true this.isBusy = true
const results = await this.callAPI('/todo', { const results = await this.callAPI('/todo', {
params: { params: {
@ -241,7 +243,7 @@ export default {
sortDirection: this.sortDirection, sortDirection: this.sortDirection,
searchFields: this.searchFields, searchFields: this.searchFields,
search: this.search, search: this.search,
page: page, page: this.currentPage,
perPage: this.perPage perPage: this.perPage
} }
}) })
@ -254,18 +256,20 @@ export default {
this.isBusy = false this.isBusy = false
}, },
searchClick() { searchClick() {
this.getDatas(1) this.currentPage = 1
this.getDatas()
}, },
pageClick(bvEvent, page) { pageClick(bvEvent, page) {
console.log(bvEvent) console.log(bvEvent)
// this.currentPage = page this.currentPage = page
this.getDatas(page) this.getDatas()
// bvEvent.preventDefault() bvEvent.preventDefault()
}, },
perPageClick(perPage) { perPageClick(perPage) {
this.currentPage = 1
this.perPage = perPage this.perPage = perPage
console.log(this.perPage) console.log(this.perPage)
this.getDatas(1) this.getDatas()
}, },
busyToggle() { busyToggle() {
this.isBusy = !this.isBusy this.isBusy = !this.isBusy