From e4f917cce73902bcec18b8a431907daea049247e Mon Sep 17 00:00:00 2001 From: qiang Date: Mon, 23 Dec 2019 16:35:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20editor=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=9C=AA=E5=90=AF=E7=94=A8=20imageToolbar=20=E6=97=B6?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/view/components/editor/index.vue | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/core/view/components/editor/index.vue b/src/core/view/components/editor/index.vue index 49beb8172..227c01dc3 100644 --- a/src/core/view/components/editor/index.vue +++ b/src/core/view/components/editor/index.vue @@ -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 => { -- GitLab