推荐一个富文本:

https://github.com/vuejs/awesome-vue  这里面记录了vue技术栈相关的 框架 组件库 插件 文章 博客 教学视频

https://github.com/surmon-china/vue-quill-editor 富文本

安装:

1、npm install vue-quill-editor

2、yarn add vue-quill-editor

挂载:

 

 1 //哪里使用挂载到哪个页面
 2 import 'quill/dist/quill.core.css'
 3 import 'quill/dist/quill.snow.css'
 4 import 'quill/dist/quill.bubble.css'
 5 
 6 // 导入指定成员(富文本组件配置对象)    在封装模块的时候,默认导出,指定导出。
 7 import { quillEditor } from 'vue-quill-editor'
 8 
 9 export default {
10   components: {
11     quillEditor
12   }
13 }
挂载

 

使用:

 

1 <quill-editor v-model="content" :options="editorOption"></quill-editor>
2 //options 配置属性  配置对象 editorOption 。
使用

 

配置富文本:

quill js插件文档地址 https://quilljs.com/docs/quickstart/

 1 editorOption: {
 2         placeholder: '',
 3         modules: {
 4           toolbar: [
 5         //配置的功能
 6             ['bold', 'italic', 'underline', 'strike'],
 7             ['blockquote', 'code-block'],
 8             [{ header: 1 }, { header: 2 }],
 9             [{ list: 'ordered' }, { list: 'bullet' }],
10             [{ indent: '-1' }, { indent: '+1' }],
11             ['image']
12           ]
13         }
14       },        
配置
posted on 2020-08-11 20:07  小菟同学  阅读(239)  评论(0编辑  收藏  举报

……