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) + }, }, }