diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue index 519b417..4e2b47a 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -45,11 +45,11 @@ class ImageHandler { // 保存当前光标位置 const range = this.quill.getSelection(true); if (!range) return; - + // 阻止Quill默认的粘贴处理 const currentHtml = this.quill.root.innerHTML; this.quill.root.innerHTML = currentHtml; - + const file = items[i].getAsFile(); this.upload(file, range, this); break; @@ -63,7 +63,7 @@ class ImageHandler { } const formData = new FormData(); formData.append('file', file); - + axios.post(process.env.VUE_APP_BASE_API + "/common/upload", formData, { headers: { Authorization: "Bearer " + getToken(), @@ -176,7 +176,7 @@ export default { if (val !== this.currentValue) { this.currentValue = val === null ? "" : val; if (this.Quill) { - this.Quill.pasteHTML(this.currentValue); + this.Quill.clipboard.dangerouslyPasteHTML(this.currentValue); } } },