提交 e4f917cc 编写于 作者: Q qiang

fix: 解决 editor 组件未启用 imageToolbar 时报错的问题

上级 9efd72e8
......@@ -226,19 +226,20 @@ export default {
},
initQuill (imageResizeModules) {
const Quill = window.Quill
Quill.register('modules/ImageResize', window.ImageResize.default)
formats.register(Quill)
const quill = this.quill = new Quill(this.$el, {
const options = {
toolbar: false,
readOnly: this.readOnly,
placeholder: this.placeholder,
modules: {
ImageResize: {
modules: imageResizeModules
}
modules: { }
}
if (imageResizeModules.length) {
Quill.register('modules/ImageResize', window.ImageResize.default)
options.modules.ImageResize = {
modules: imageResizeModules
}
})
}
const quill = this.quill = new Quill(this.$el, options)
const $el = quill.root
const events = ['focus', 'blur']
events.forEach(name => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册