mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 19:23:26 +00:00
fix: 编辑消息@丢失的问题
This commit is contained in:
parent
6ea3918a8b
commit
2fca82d7c5
@ -251,6 +251,8 @@ export default {
|
|||||||
touchLimitX: false,
|
touchLimitX: false,
|
||||||
touchLimitY: false,
|
touchLimitY: false,
|
||||||
|
|
||||||
|
pasteClean: true,
|
||||||
|
|
||||||
isSpecVersion: this.checkIOSVersion(),
|
isSpecVersion: this.checkIOSVersion(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -661,6 +663,9 @@ export default {
|
|||||||
|
|
||||||
// Clipboard Matcher (保留图片跟空格,清除其余所以样式)
|
// Clipboard Matcher (保留图片跟空格,清除其余所以样式)
|
||||||
this.quill.clipboard.addMatcher(Node.ELEMENT_NODE, (node, delta) => {
|
this.quill.clipboard.addMatcher(Node.ELEMENT_NODE, (node, delta) => {
|
||||||
|
if (!this.pasteClean) {
|
||||||
|
return delta
|
||||||
|
}
|
||||||
delta.ops = delta.ops.map(op => {
|
delta.ops = delta.ops.map(op => {
|
||||||
const obj = {
|
const obj = {
|
||||||
attributes: {},
|
attributes: {},
|
||||||
@ -780,6 +785,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setPasteMode(bool) {
|
||||||
|
this.pasteClean = bool
|
||||||
|
},
|
||||||
|
|
||||||
getInputCache() {
|
getInputCache() {
|
||||||
const item = this.dialogInputCache.find(item => item.key == this.cacheKey);
|
const item = this.dialogInputCache.find(item => item.key == this.cacheKey);
|
||||||
return item ? item.cache : '';
|
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(/<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>')
|
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.msgText = $A.formatMsgBasic(text)
|
||||||
|
this.$nextTick(_ => {
|
||||||
|
this.$refs.input.setPasteMode(true)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user