From e49543ad5522ca64cda7fca276b2afe45a69ddc4 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 16 Mar 2022 11:03:45 +0100 Subject: [PATCH] add function resetTransactionLinkList, loadMoreLinks and computed buttonText --- .../DecayInformations/CollapseLinksList.vue | 39 +++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/DecayInformations/CollapseLinksList.vue b/frontend/src/components/DecayInformations/CollapseLinksList.vue index 275615de1..7492532b6 100644 --- a/frontend/src/components/DecayInformations/CollapseLinksList.vue +++ b/frontend/src/components/DecayInformations/CollapseLinksList.vue @@ -14,8 +14,24 @@ v-for="item in transactionLinks" :key="item.id" v-bind:item="item" - @update-list-transaction-links="updateListTransactionLinks" + @reset-transaction-link-list="resetTransactionLinkList" /> +
+ + {{ buttonText }} + + +
@@ -30,10 +46,27 @@ export default { }, props: { transactionLinks: { type: Array, required: true }, + transactionLinkCount: { + type: Number, + required: true, + }, + value: { type: Object, required: true }, }, methods: { - updateListTransactionLinks() { - this.$emit('update-list-transaction-links') + resetTransactionLinkList() { + this.$emit('input', { ...this.value, currentPage: 0 }) + }, + loadMoreLinks() { + this.$emit('input', { ...this.value, currentPage: this.value.currentPage + 1 }) + }, + }, + computed: { + buttonText() { + if (this.transactionLinkCount - this.value.itemsShown > this.value.pageSize) + return 'weitere ' + this.value.pageSize + ' Links Nachladen' + return ( + 'die letzten ' + (this.transactionLinkCount - this.value.itemsShown) + ' Links nachladen' + ) }, }, }