Skip to content

Commit 6caed15

Browse files
YunaiVgitee-org
authored andcommitted
!827 fix: 修复 Editor 切换 readonly 时只读状态无效的 bug
Merge pull request !827 from 局外人/fix/editor
2 parents 9bc289c + 5bc3c90 commit 6caed15

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/components/Editor/src/Editor.vue

Lines changed: 16 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
@@ -90,6 +100,12 @@ const editorConfig = computed((): IEditorConfig => {
90100
},
91101
autoFocus: false,
92102
scroll: true,
103+
EXTEND_CONF: {
104+
mentionConfig: {
105+
showModal: () => {},
106+
hideModal: () => {}
107+
}
108+
},
93109
MENU_CONF: {
94110
['uploadImage']: {
95111
server: getUploadUrl(),

0 commit comments

Comments
 (0)