fix: update CodemirrorEditor

This commit is contained in:
yanglbme 2020-07-30 15:13:43 +08:00
parent 7eb8e99be5
commit a5a254c0d1

View File

@ -17,19 +17,11 @@
</el-header> </el-header>
<el-main class="main-body"> <el-main class="main-body">
<el-row class="main-section"> <el-row class="main-section">
<el-col :span="12" <el-col :span="12" @contextmenu.prevent.native="openMenu($event)">
@contextmenu.prevent.native="openMenu($event)"
>
<textarea id="editor" type="textarea" placeholder="Your markdown text here." v-model="source"> <textarea id="editor" type="textarea" placeholder="Your markdown text here." v-model="source">
</textarea> </textarea>
</el-col> </el-col>
<el-col <el-col :span="12" class="preview-wrapper" id="preview" ref="preview" :class="{'preview-wrapper_night': nightMode && isCoping}">
:span="12"
class="preview-wrapper"
id="preview"
ref="preview"
:class="{'preview-wrapper_night': nightMode && isCoping}"
>
<section id="output-wrapper" :class="{'output_night': nightMode && !backLight}"> <section id="output-wrapper" :class="{'output_night': nightMode && !backLight}">
<div class="preview"> <div class="preview">
<section id="output" v-html="output"> <section id="output" v-html="output">
@ -139,23 +131,17 @@ export default {
let item = e.clipboardData.items[i] let item = e.clipboardData.items[i]
if (item.kind === 'file') { if (item.kind === 'file') {
this.isImgLoading = true; this.isImgLoading = true;
this.$message({
showClose: true,
message: '正在加载资源'
});
const pasteFile = item.getAsFile() const pasteFile = item.getAsFile()
uploadImgFile(pasteFile).then(res=> { uploadImgFile(pasteFile).then(res=> {
this.uploaded(res) this.uploaded(res)
this.isImgLoading = false;
}).catch(err=> { }).catch(err=> {
this.$message({ this.$message({
showClose: true, showClose: true,
message: err, message: err,
type: 'error' type: 'error'
}); });
this.isImgLoading = false;
}); });
this.isImgLoading = false;
} }
} }
}); });