Commit efce482b3215ddf9ed588f63a218d5f76939e947

Authored by liuzhidong
Committed by GitHub
1 parent bcad95d3

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

*富文本目前只支持初始化配置,本次增加了只读状态动态设置,只需更改readonly的值
src/components/Tinymce/src/Editor.vue
... ... @@ -174,6 +174,10 @@
174 174 const disabled = computed(() => {
175 175 const { options } = props;
176 176 const getdDisabled = options && Reflect.get(options, 'readonly');
  177 + const editor = unref(editorRef);
  178 + if (editor) {
  179 + editor.setMode(getdDisabled ? 'readonly' : 'design');
  180 + }
177 181 return getdDisabled ?? false;
178 182 });
179 183  
... ...