style: update codemirror editor

This commit is contained in:
yanglbme 2020-07-13 20:38:08 +08:00
parent 0cd2301fbd
commit 2688b1502c

View File

@ -187,8 +187,14 @@ export default {
},
//
uploaded(response) {
if (response) {
if (response.success) {
if (!response || !response.success) {
this.$message({
showClose: true,
message: '上传图片未知异常',
type: 'error'
});
return;
}
//
const cursor = this.editor.getCursor();
const imageUrl = response.data;
@ -201,21 +207,6 @@ export default {
type: 'success'
});
this.onEditorRefresh();
} else {
//
this.$message({
showClose: true,
message: response.message,
type: 'error'
});
}
} else {
this.$message({
showClose: true,
message: '上传图片未知异常',
type: 'error'
});
}
},
//
leftAndRightScroll() {
@ -277,13 +268,7 @@ export default {
const offsetWidth = this.$el.offsetWidth;
const maxLeft = offsetWidth - menuMinWidth;
const left = e.clientX - offsetLeft;
if (left > maxLeft) {
this.mouseLeft = maxLeft;
} else {
this.mouseLeft = left;
}
this.mouseLeft = Math.min(maxLeft, left);
this.mouseTop = e.clientY + 10;
this.rightClickMenuVisible = true;
},