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

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