vue-quill-editor获取值问题

新手上路,请多包涵

做的博客系统编辑文章功能

editor无法获取传过来的文章内容

<div class="ql-conrainer ql-snow">
    <quill-editor
        class="editor"
        v-model="content"
        ref="myQuillEditor"
        :options="editorOption"
        @blur="onEditorBlur($event)"
        @focus="onEditorFocus($event)"
    
    ></quill-editor>
</div>

属性

props: {
    /*编辑器的内容*/
    value: {
        type: String
    }
},

components: {
    quillEditor
},

data() {
    return {
        content: this.value,
        editorOption: {
            placeholder: "",
            theme: "snow", // or 'bubble'
            placeholder: "请输入...",
            modules: {
                toolbar: {
                    container: toolbarOptions,
                    // container: "#toolbar",
                }
            }
        },
    };
},

methods: {
    onEditorBlur() {
        //失去焦点事件
    },
    onEditorFocus() {
        //获得焦点事件
    },
    onEditorChange() {
        //内容改变事件
        this.$emit("input", this.content);
    }
},
computed: {
    editor() {
        return this.$refs.myQuillEditor.quill;
    },
    
}

1.png
2.png

阅读 9.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题