1、安装
npm install vue-quill-editor --save
2、使用
引入vue-quill-editor
import { quillEditor } from 'vue-quill-editor'
<!-- -->
<quill-editor ref="myTextEditor" :content="content"//内容对应的字段 :options = "editorOption" @change="onEditorChange($event)">//内容改变事件 </quill-editor>
export default { components: { quillEditor },data(){ content:"" },methods: { onEditorChange({ editor, html, text }) {//富文本编辑器 文本改变时 设置字段值 this.content = html } }}
参考文章:https://www.awesomes.cn/repo/surmon-china/vue-quill-editor