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

*富文本目前只支持初始化配置,本次增加了只读状态动态设置,只需更改readonly的值
This commit is contained in:
liuzhidong 2021-06-07 21:28:26 +08:00 committed by GitHub
parent bcad95d32a
commit efce482b32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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;
});