placeholder: ‘Compose an epic…’,
debug: ‘error’,
modules: {
toolbar: {
// 工具栏的配置项
container: this.$options.toolbarOptions
}
}
})
this.quill = quill
/**
-
监听富文本变化
-
editor-change 包括 text-change、selection-change
-
你也可以分别监听 text-change 和 selection-change
-
文档:https://quilljs.com/docs/api/#text-change
*/
quill.on(‘editor-change’, this.onEditorChange)
}
=======================================================================
quill
默认的图片上传功能是图片转成 bse64
编码字符串,纯前端玩玩还行;
项目中,这样是不太合适的,而且几十兆的那种大图片,转成 base64
字符串是很长很长的一大串。
1、初始化覆盖默认的上传功能
- 给
image
自定义一个上传的方法
modules: {
toolbar: {
container: this.$options.toolbarOptions,
handlers: { // 自定义功能
‘image’: this.$options.imageFunction
}
},
…
}
2、页面中加入了 Element-UI
的上传功能,然后使用 css
让上传按钮不