Fandom-OSS / quill-blot-formatter

A module for Quill that allows editor elements to be resized, repositioned, etc.
Apache License 2.0
135 stars 50 forks source link

Respect quill.enable #19

Open ronnyroeller opened 4 years ago

ronnyroeller commented 4 years ago

I added quill-blot-formatter to a QuillJS editor. This correctly shows the controls to resize any image. Yet, after disabling Quill via quill.enable(false), I'd expect the resizing control to be not available.

0Shino0 commented 11 months ago

If you're using @vueup/vue-quill, you can disable it like this when you don't need it

    // template ... 
    <QuillEditor
      class="quill-editor-container"
      :options="options"
      :enable="isEditor_"
    ></QuillEditor>

    // script ...
    const options = ref({
      // debug: 'info',
      modules: {
        BlotFormatter: {} as any, 
      placeholder: '支持Markdown或者富文本',
      readOnly: false,
    })

    // ... 
    if (!isEditor_.value) { // When you don't need it 
      options.value.modules.BlotFormatter = undefined // 不可编辑时 禁用BlotFormatter
    }