From d168a847abb028e41799c2ff632a4861346cf849 Mon Sep 17 00:00:00 2001 From: Josh Creek Date: Fri, 24 May 2019 17:15:11 +0100 Subject: [PATCH] Added ability to select a tag but only works with one new transaction when there are duplicates too. --- src/components/ApplyTag.vue | 30 +++++++++++++++++++++++++++--- src/views/Home.vue | 7 ++++--- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/components/ApplyTag.vue b/src/components/ApplyTag.vue index 5f0769a..aab630f 100644 --- a/src/components/ApplyTag.vue +++ b/src/components/ApplyTag.vue @@ -5,9 +5,22 @@ - + + @@ -19,6 +32,7 @@ name: 'app', props: [ "transaction", + "tagsExpenditure", "isModalVisible" ], components: { @@ -26,14 +40,24 @@ }, data () { return { + selectedTag: "" }; }, methods: { + closeModal() { + this.$emit('close'); + }, showModal() { this.$emit('show'); }, - closeModal() { + saveTransaction() { + const newTransaction = this.transaction; + var newTags = []; + newTags.push(this.selectedTag); + newTransaction.tags = newTags; + this.$emit('close'); + this.$emit('add', newTransaction); } }, }; diff --git a/src/views/Home.vue b/src/views/Home.vue index 9814715..a37b108 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -1,6 +1,6 @@