vue富文本插件vue-quill-editor的使用

本文档介绍了如何在Vue项目中安装和使用vue-quill-editor富文本插件,包括设置编辑器选项、自定义工具栏以及处理图片和视频上传等功能。
摘要由CSDN通过智能技术生成
  1. 首先下载vue-quill-editor   cnpm install vue-quill-editor --save
  2. 新建公共组件quillEditor.vue,在quillEditor.vue中的html代码如下:
    < template>
    < quill-editor v-model="content" ref= "myTextEditor" :options="editorOption"
    @change="onChange" placeholder= "111">
    < div id= "toolbar" slot= "toolbar">
    < span class= "ql-formats">
    < button type= "button" class= "ql-bold"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-italic"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-underline"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-strike"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-blockquote"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-code-block"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-header" value= "1"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-header" value= "2"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-list" value= "ordered"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-list" value= "bullet"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-script" value= "sub"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-script" value= "super"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-indent" value= "-1"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-indent" value= "+1"></ button>
    </ span>
    < span class= "ql-formats">
    < button type= "button" class= "ql-direction" value= "rtl"></ button>
    </ span>
    < span class= "ql-formats">< select class= "ql-size">
    < option value= "small">10px</ option>
    < option selected>14px</ option>
    < option value= "large">18px</ option>
    < option value= "huge">32px</ option>
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值