Skip to content

Commit a1a2818

Browse files
committed
chore: add watcher for readonly to update editor options
1 parent be4ead6 commit a1a2818

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/monaco/Monaco.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ onMounted(async () => {
113113
monaco.editor.setModelLanguage(editorInstance.getModel()!, lang)
114114
)
115115
116+
watch(
117+
() => props.readonly,
118+
(readonly) => {
119+
editorInstance.updateOptions({ readOnly: readonly })
120+
}
121+
)
122+
116123
if (!props.readonly) {
117124
watch(
118125
() => props.filename,

0 commit comments

Comments
 (0)