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

pref:修改富文本编辑器

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