修复选项清空bug

This commit is contained in:
alvis
2021-02-23 08:51:04 +08:00
parent cb9c5ffcc5
commit aac89f3df7
32 changed files with 61 additions and 56 deletions

View File

@@ -157,8 +157,13 @@ export default {
},
questionItemAdd () {
let items = this.form.items
let last = items[items.length - 1]
let newLastPrefix = String.fromCharCode(last.prefix.charCodeAt() + 1)
let newLastPrefix
if (items.length > 0) {
let last = items[items.length - 1]
newLastPrefix = String.fromCharCode(last.prefix.charCodeAt() + 1)
} else {
newLastPrefix = 'A'
}
items.push({ id: null, prefix: newLastPrefix, content: '' })
},
submitForm () {