Fix that pagination on gdd-transactions-list not hides if ther's only one page

This commit is contained in:
Wolfgang Huß 2022-05-04 10:09:26 +02:00
parent 737859db89
commit 945e0a3fd9
2 changed files with 12 additions and 7 deletions

View File

@ -61,7 +61,7 @@
</div>
</div>
<b-pagination
v-if="showPagination"
v-if="isPaginationVisible"
class="mt-3"
pills
size="lg"
@ -96,11 +96,6 @@ export default {
TransactionCreation,
TransactionLinkSummary,
},
data() {
return {
currentPage: 1,
}
},
props: {
transactions: { default: () => [] },
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()

View File

@ -9,7 +9,7 @@
:transactionCount="transactionCount"
:transactionLinkCount="transactionLinkCount"
:transactions="transactions"
:show-pagination="true"
:showPagination="true"
@update-transactions="updateTransactions"
v-on="$listeners"
/>