修复可以发一个空格消息的问题

This commit is contained in:
kuaifan 2022-06-05 21:09:19 +08:00
parent 2f649c0a9e
commit c2b754d682

View File

@ -128,6 +128,10 @@ export default {
components: {ChatEmoji},
directives: {touchmouse, TransferDom, clickoutside},
props: {
value: {
type: [String, Number],
default: ''
},
dialogId: {
type: Number,
default: 0
@ -136,10 +140,6 @@ export default {
type: Number,
default: 0
},
value: {
type: [String, Number],
default: ''
},
placeholder: {
type: String,
default: ''
@ -528,7 +528,8 @@ export default {
this.quill.deleteText(this.maxlength, this.quill.getLength());
}
let html = this.$refs.editor.children[0].innerHTML
html = html.replace(/^(<p><br><\/p>)+|(<p><br><\/p>)+$/gi, '')
html = html.replace(/^(<p>\s*<\/p>)+|(<p>\s*<\/p>)+$/gi, '')
html = html.replace(/^(<p><br\/*><\/p>)+|(<p><br\/*><\/p>)+$/gi, '')
this._content = html
this.$emit('input', this._content)
this.$nextTick(_ => {