From 7e997aada50e7cddc8a3fe43d22ba5fcd82c3967 Mon Sep 17 00:00:00 2001 From: tsh96 Date: Sun, 12 Sep 2021 04:59:10 +0800 Subject: [PATCH] fix: resolve admin pages pagination bug (#4280) --- client/components/admin/admin-pages.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/components/admin/admin-pages.vue b/client/components/admin/admin-pages.vue index 4bd5958c..0ca26de1 100644 --- a/client/components/admin/admin-pages.vue +++ b/client/components/admin/admin-pages.vue @@ -61,6 +61,7 @@ sort-by='updatedAt', sort-desc, hide-default-footer + @page-count="pageTotal = $event" ) template(slot='item', slot-scope='props') tr.is-clickable(:active='props.selected', @click='$router.push(`/pages/` + props.item.id)') @@ -89,6 +90,7 @@ export default { selectedPage: {}, pagination: 1, pages: [], + pageTotal: 0, headers: [ { text: 'ID', value: 'id', width: 80, sortable: true }, { text: 'Title', value: 'title' }, @@ -108,9 +110,6 @@ export default { } }, computed: { - pageTotal () { - return Math.ceil(this.filteredPages.length / 15) - }, filteredPages () { return _.filter(this.pages, pg => { if (this.selectedLang !== null && this.selectedLang !== pg.locale) {