mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-07 09:57:37 +00:00
fix: 编辑消息@丢失的问题
This commit is contained in:
parent
6ea3918a8b
commit
2fca82d7c5
@ -251,6 +251,8 @@ export default {
|
||||
touchLimitX: false,
|
||||
touchLimitY: false,
|
||||
|
||||
pasteClean: true,
|
||||
|
||||
isSpecVersion: this.checkIOSVersion(),
|
||||
};
|
||||
},
|
||||
@ -661,6 +663,9 @@ export default {
|
||||
|
||||
// Clipboard Matcher (保留图片跟空格,清除其余所以样式)
|
||||
this.quill.clipboard.addMatcher(Node.ELEMENT_NODE, (node, delta) => {
|
||||
if (!this.pasteClean) {
|
||||
return delta
|
||||
}
|
||||
delta.ops = delta.ops.map(op => {
|
||||
const obj = {
|
||||
attributes: {},
|
||||
@ -780,6 +785,10 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
setPasteMode(bool) {
|
||||
this.pasteClean = bool
|
||||
},
|
||||
|
||||
getInputCache() {
|
||||
const item = this.dialogInputCache.find(item => item.key == this.cacheKey);
|
||||
return item ? item.cache : '';
|
||||
|
||||
@ -1898,7 +1898,11 @@ export default {
|
||||
text = text.replace(/<a class="mention file" href="([^'"]*)"([^>]*)>~([^>]*)<\/a>/g, '<span class="mention" data-denotation-char="~" data-id="$1" data-value="$3"><span contenteditable="false"><span class="ql-mention-denotation-char">~</span>$3</span></span>')
|
||||
text = text.replace(/<span class="mention ([^'"]*)" data-id="(\d+)">([@#])([^>]*)<\/span>/g, '<span class="mention" data-denotation-char="$3" data-id="$2" data-value="$4"><span contenteditable="false"><span class="ql-mention-denotation-char">$3</span>$4</span></span>')
|
||||
}
|
||||
this.$refs.input.setPasteMode(false)
|
||||
this.msgText = $A.formatMsgBasic(text)
|
||||
this.$nextTick(_ => {
|
||||
this.$refs.input.setPasteMode(true)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user