This commit is contained in:
yanran200730
2022-08-01 09:42:15 +08:00
parent 27c4ae42d0
commit db2e3811f5
4 changed files with 44 additions and 36 deletions

View File

@@ -164,18 +164,20 @@
}, },
confirm () { confirm () {
if (!this.content) {
return false
}
if (this.currIndex >= 0) { if (this.currIndex >= 0) {
this.richList[this.currIndex].value = this.content if (!this.content) {
this.richList.splice(this.currIndex, 1)
} else { } else {
this.richList[this.currIndex].value = this.content
}
} else {
if (this.content) {
this.richList.push({ this.richList.push({
type: 'text', type: 'text',
value: this.content value: this.content
}) })
} }
}
this.isShowText = false this.isShowText = false
this.content = '' this.content = ''

View File

@@ -174,18 +174,20 @@
}, },
confirm () { confirm () {
if (!this.content) {
return false
}
if (this.currIndex >= 0) { if (this.currIndex >= 0) {
this.richList[this.currIndex].value = this.content if (!this.content) {
this.richList.splice(this.currIndex, 1)
} else { } else {
this.richList[this.currIndex].value = this.content
}
} else {
if (this.content) {
this.richList.push({ this.richList.push({
type: 'text', type: 'text',
value: this.content value: this.content
}) })
} }
}
this.isShowText = false this.isShowText = false
this.content = '' this.content = ''

View File

@@ -195,18 +195,20 @@
}, },
confirm () { confirm () {
if (!this.content) {
return false
}
if (this.currIndex >= 0) { if (this.currIndex >= 0) {
this.richList[this.currIndex].value = this.content if (!this.content) {
this.richList.splice(this.currIndex, 1)
} else { } else {
this.richList[this.currIndex].value = this.content
}
} else {
if (this.content) {
this.richList.push({ this.richList.push({
type: 'text', type: 'text',
value: this.content value: this.content
}) })
} }
}
this.isShowText = false this.isShowText = false
this.content = '' this.content = ''

View File

@@ -165,18 +165,20 @@
}, },
confirm () { confirm () {
if (!this.content) {
return false
}
if (this.currIndex >= 0) { if (this.currIndex >= 0) {
this.richList[this.currIndex].value = this.content if (!this.content) {
this.richList.splice(this.currIndex, 1)
} else { } else {
this.richList[this.currIndex].value = this.content
}
} else {
if (this.content) {
this.richList.push({ this.richList.push({
type: 'text', type: 'text',
value: this.content value: this.content
}) })
} }
}
this.isShowText = false this.isShowText = false
this.content = '' this.content = ''