增加右键菜单配置

增加setEditorValue、getEditorValue方法
修改updateContact传参
修复只选择表情发送按钮是灰色的问题
修复send之后toContactId丢失的问题
This commit is contained in:
fan
2021-01-30 21:03:15 +08:00
parent f56dc40075
commit 3603d0c03b
23 changed files with 825 additions and 184 deletions
+8 -3
View File
@@ -1,5 +1,5 @@
<script>
import { toEmojiName,useScopedSlot,clearHtml } from "utils";
import { toEmojiName,useScopedSlot,clearHtmlExcludeImg } from "utils";
const exec = (val, command = "insertHTML") => {
document.execCommand(command, false, val);
};
@@ -212,6 +212,7 @@ export default {
_handleSelectEmoji(item) {
this._focusLastRange();
exec(`<img emoji-name="${item.name}" src="${item.src}"></img>`);
this._checkSubmitDisabled();
this._saveLastRange();
},
async selectFile(accept) {
@@ -248,7 +249,7 @@ export default {
return toEmojiName(this.$refs.textarea.innerHTML);
},
_checkSubmitDisabled() {
this.submitDisabled = !this.$refs.textarea.innerText.trim();
this.submitDisabled = !clearHtmlExcludeImg(this.$refs.textarea.innerHTML.trim());
},
_handleSend(e) {
const text = this.getFormatValue();
@@ -269,7 +270,11 @@ export default {
initEmoji(data) {
emojiData = data;
this.$forceUpdate();
}
},
setValue(val){
this.$refs.textarea.innerHTML = val;
this._checkSubmitDisabled();
},
}
};
</script>