Compare commits
2 Commits
feat/workf
...
enh/create
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0949886348 | ||
|
|
e4ccf431a4 |
@@ -53,13 +53,13 @@
|
||||
|
||||
<form v-if="showAddCard" class="stack--card-add" @submit.prevent="clickAddCard()">
|
||||
<label for="new-stack-input-main" class="hidden-visually">{{ t('deck', 'Add a new card') }}</label>
|
||||
<input id="new-stack-input-main"
|
||||
<textarea id="new-stack-input-main"
|
||||
v-model="newCardTitle"
|
||||
v-focus
|
||||
type="text"
|
||||
class="no-close"
|
||||
placeholder="Add a new card"
|
||||
required>
|
||||
required />
|
||||
|
||||
<input class="icon-confirm"
|
||||
type="submit"
|
||||
@@ -161,14 +161,32 @@ export default {
|
||||
this.editing = false
|
||||
},
|
||||
clickAddCard() {
|
||||
|
||||
const match = /\r|\n/.exec(this.newCardTitle)
|
||||
if (match) {
|
||||
console.log(match)
|
||||
const results = this.newCardTitle.split(match[0])
|
||||
results.forEach((line) => {
|
||||
|
||||
this.addCard(line)
|
||||
})
|
||||
|
||||
this.newCardTitle = ''
|
||||
this.showAddCard = false
|
||||
|
||||
} else {
|
||||
this.addCard(this.newCardTitle)
|
||||
this.newCardTitle = ''
|
||||
this.showAddCard = false
|
||||
}
|
||||
},
|
||||
addCard(title) {
|
||||
const newCard = {
|
||||
title: this.newCardTitle,
|
||||
title: title,
|
||||
stackId: this.stack.id,
|
||||
boardId: this.stack.boardId,
|
||||
}
|
||||
this.$store.dispatch('addCard', newCard)
|
||||
this.newCardTitle = ''
|
||||
this.showAddCard = false
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user