Commit 123742d9 authored by “yiyousong”'s avatar “yiyousong”

pref:修改富文本编辑器

parent a618eefe
...@@ -14,12 +14,11 @@ ...@@ -14,12 +14,11 @@
<!-- 富文本 --> <!-- 富文本 -->
<quill-editor <quill-editor
class="editor ql-editor" class="editor ql-editor"
v-model="value" v-model="contnet"
ref="myQuillEditor" ref="myQuillEditor"
:options="editorOption" :options="editorOption"
@blur="onEditorBlur($event)" @blur="onEditorBlur($event)"
@focus="onEditorFocus($event)" @focus="onEditorFocus($event)"
@change="onEditorChange($event)"
> >
</quill-editor> </quill-editor>
</div> </div>
...@@ -106,9 +105,7 @@ export default { ...@@ -106,9 +105,7 @@ export default {
data() { data() {
return { return {
quillUpdateImg: false, // 根据图片上传状态来确定是否显示loading动画,刚开始是false,不显示 quillUpdateImg: false, // 根据图片上传状态来确定是否显示loading动画,刚开始是false,不显示
api: process.env.VUE_APP_API_BASE_URL.includes("base") api: process.env.VUE_APP_API_BASE_URL + "/",
? process.env.VUE_APP_API_BASE_URL.replace("base", "")
: process.env.VUE_APP_API_BASE_URL + "/",
editorOption: { editorOption: {
theme: "snow", // or 'bubble' theme: "snow", // or 'bubble'
placeholder: "请输入文本......", placeholder: "请输入文本......",
...@@ -151,7 +148,16 @@ export default { ...@@ -151,7 +148,16 @@ export default {
}, },
}; };
}, },
computed: {
contnet: {
get() {
return this.value;
},
set(val) {
this.$emit("input", val);
},
},
},
methods: { methods: {
onEditorBlur() { onEditorBlur() {
//失去焦点事件 //失去焦点事件
...@@ -159,10 +165,6 @@ export default { ...@@ -159,10 +165,6 @@ export default {
onEditorFocus() { onEditorFocus() {
//获得焦点事件 //获得焦点事件
}, },
onEditorChange() {
//内容改变事件
this.$emit("input", this.value);
},
// 富文本图片上传前 // 富文本图片上传前
beforeUpload() { beforeUpload() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment