debug: 2.0.2版本编辑器API修改
This commit is contained in:
parent
41d5eb5297
commit
e131da3db0
|
@ -45,11 +45,11 @@ class ImageHandler {
|
||||||
// 保存当前光标位置
|
// 保存当前光标位置
|
||||||
const range = this.quill.getSelection(true);
|
const range = this.quill.getSelection(true);
|
||||||
if (!range) return;
|
if (!range) return;
|
||||||
|
|
||||||
// 阻止Quill默认的粘贴处理
|
// 阻止Quill默认的粘贴处理
|
||||||
const currentHtml = this.quill.root.innerHTML;
|
const currentHtml = this.quill.root.innerHTML;
|
||||||
this.quill.root.innerHTML = currentHtml;
|
this.quill.root.innerHTML = currentHtml;
|
||||||
|
|
||||||
const file = items[i].getAsFile();
|
const file = items[i].getAsFile();
|
||||||
this.upload(file, range, this);
|
this.upload(file, range, this);
|
||||||
break;
|
break;
|
||||||
|
@ -63,7 +63,7 @@ class ImageHandler {
|
||||||
}
|
}
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
|
|
||||||
axios.post(process.env.VUE_APP_BASE_API + "/common/upload", formData, {
|
axios.post(process.env.VUE_APP_BASE_API + "/common/upload", formData, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + getToken(),
|
Authorization: "Bearer " + getToken(),
|
||||||
|
@ -176,7 +176,7 @@ export default {
|
||||||
if (val !== this.currentValue) {
|
if (val !== this.currentValue) {
|
||||||
this.currentValue = val === null ? "" : val;
|
this.currentValue = val === null ? "" : val;
|
||||||
if (this.Quill) {
|
if (this.Quill) {
|
||||||
this.Quill.pasteHTML(this.currentValue);
|
this.Quill.clipboard.dangerouslyPasteHTML(this.currentValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user