vue-quill-editor readOnly不生效

vue-quill-editor readOnly不生效

  1. 问题描述
    富文本编辑器设置只读状态:配置了参数readOnly: true,仍可以编辑, 当前vue-quill-editor版本为3.0.6
<quill-editor v-model="content"
                  :options="editorOption"
                  ref="content">
 </quill-editor>
       content: '',
      editorOption: {
        placeholder: '提示语',
        modules: {
          toolbar: {
            container: toolbarOptions
          }
        },
        theme: 'snow', //  'bubble'或者'snow'
        readOnly: true
      }
  1. 解决方案

(1) 方案一: 更换vue-quill-editor的版本为3.0.4(亲测有效)
(2) 方案二:给组件绑定disabled属性,通过改变disabled的值更改编辑器的状态

<quill-editor
      v-model='content'
      :options='editorOption'
      :disabled='disabled'
></quill-editor>
  1. 参考链接
    https://github.com/surmon-china/vue-quill-editor/issues/215

你可能感兴趣的:(vue)