fix: 修复 Editor 切换 readonly 时只读状态无效的 bug

pull/827/head
朱桂志 2025-10-10 18:20:50 +08:00
parent 2e1ef8aee4
commit 5bc3c9090b
1 changed files with 10 additions and 0 deletions

View File

@ -58,6 +58,16 @@ watch(
emit('update:modelValue', val)
}
)
watch(
() => props.readonly,
(val) => {
if (val) {
editorRef.value?.disable()
} else {
editorRef.value?.enable()
}
}
)
const handleCreated = (editor: IDomEditor) => {
editorRef.value = editor