From 0949886348e8c093ef8f7de59a512498f867e7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6hrl?= Date: Fri, 31 Jan 2020 08:43:59 +0100 Subject: [PATCH] now it's working MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Röhrl --- src/components/board/Stack.vue | 43 +++++++++++++++------------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/src/components/board/Stack.vue b/src/components/board/Stack.vue index 44211d1c9..38105aa6d 100644 --- a/src/components/board/Stack.vue +++ b/src/components/board/Stack.vue @@ -59,8 +59,7 @@ type="text" class="no-close" placeholder="Add a new card" - required> - + required /> (line) => { - - let newCard = { - title: line, - stackId: this.stack.id, - boardId: this.stack.boardId, - } - - this.$store.dispatch('addCard', newCard) - this.newCardTitle = '' - this.showAddCard = false + console.log(match) + const results = this.newCardTitle.split(match[0]) + results.forEach((line) => { + + this.addCard(line) }) - } else { - - const newCard = { - title: this.newCardTitle, - stackId: this.stack.id, - boardId: this.stack.boardId, - } - - this.$store.dispatch('addCard', newCard) this.newCardTitle = '' this.showAddCard = false + } else { + this.addCard(this.newCardTitle) + this.newCardTitle = '' + this.showAddCard = false } }, + addCard(title) { + const newCard = { + title: title, + stackId: this.stack.id, + boardId: this.stack.boardId, + } + this.$store.dispatch('addCard', newCard) + }, }, }