Skip to content

Commit 5bc3c90

Browse files
committed
fix: 修复 Editor 切换 readonly 时只读状态无效的 bug
1 parent 2e1ef8a commit 5bc3c90

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/components/Editor/src/Editor.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ watch(
5858
emit('update:modelValue', val)
5959
}
6060
)
61+
watch(
62+
() => props.readonly,
63+
(val) => {
64+
if (val) {
65+
editorRef.value?.disable()
66+
} else {
67+
editorRef.value?.enable()
68+
}
69+
}
70+
)
6171
6272
const handleCreated = (editor: IDomEditor) => {
6373
editorRef.value = editor

0 commit comments

Comments
 (0)