美文网首页
vue-quill-editor 富文本编辑文字大小后,v-ht

vue-quill-editor 富文本编辑文字大小后,v-ht

作者: 啊柒柒柒 | 来源:发表于2019-12-10 17:54 被阅读0次

1、使用vue-quill-editor

安装

npm install vue-quill-editor

在main.js中进行引入

import Vue from 'vue'
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

使用

Vue.use(VueQuillEditor)

在页面中使用

    <quill-editor 
        v-model="content" 
        ref="myQuillEditor" 
        :options="editorOption" 
        @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"
        @change="onEditorChange($event)">
    </quill-editor>

富文本保存后显示

需要 ql-editor 这个class名称 不然设置的样式不会生效

<div class="ql-editor" v-html="data"></div>

相关文章

网友评论

      本文标题:vue-quill-editor 富文本编辑文字大小后,v-ht

      本文链接:https://www.haomeiwen.com/subject/tfwggctx.html