From 945e0a3fd9d3d5d4d69e36175466ddff404278d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 4 May 2022 10:09:26 +0200 Subject: [PATCH] Fix that pagination on gdd-transactions-list not hides if ther's only one page --- frontend/src/components/GddTransactionList.vue | 17 +++++++++++------ frontend/src/pages/Transactions.vue | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/GddTransactionList.vue b/frontend/src/components/GddTransactionList.vue index 34f7c24ab..bbb822ad9 100644 --- a/frontend/src/components/GddTransactionList.vue +++ b/frontend/src/components/GddTransactionList.vue @@ -61,7 +61,7 @@ [] }, pageSize: { type: Number, default: 25 }, @@ -110,6 +105,11 @@ export default { showPagination: { type: Boolean, default: false }, pending: { type: Boolean }, }, + data() { + return { + currentPage: 1, + } + }, methods: { updateTransactions() { this.$emit('update-transactions', { @@ -123,6 +123,11 @@ export default { return '0' }, }, + computed: { + isPaginationVisible() { + return this.showPagination && this.pageSize < this.transactions.length + }, + }, watch: { currentPage() { this.updateTransactions() diff --git a/frontend/src/pages/Transactions.vue b/frontend/src/pages/Transactions.vue index 568f80df2..109e3f19c 100644 --- a/frontend/src/pages/Transactions.vue +++ b/frontend/src/pages/Transactions.vue @@ -9,7 +9,7 @@ :transactionCount="transactionCount" :transactionLinkCount="transactionLinkCount" :transactions="transactions" - :show-pagination="true" + :showPagination="true" @update-transactions="updateTransactions" v-on="$listeners" />