Explorar el Código

feat(Tinymce): add dynamics to the read-only state of the rich text editor (#725)

*富文本目前只支持初始化配置,本次增加了只读状态动态设置,只需更改readonly的值
liuzhidong hace 3 años
padre
commit
efce482b32
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      src/components/Tinymce/src/Editor.vue

+ 4 - 0
src/components/Tinymce/src/Editor.vue

@@ -174,6 +174,10 @@
       const disabled = computed(() => {
         const { options } = props;
         const getdDisabled = options && Reflect.get(options, 'readonly');
+        const editor = unref(editorRef);
+        if (editor) {
+          editor.setMode(getdDisabled ? 'readonly' : 'design');
+        }
         return getdDisabled ?? false;
       });