We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef545e6 commit 49fdc71Copy full SHA for 49fdc71
src/monaco/Monaco.vue
@@ -94,15 +94,17 @@ onMounted(async () => {
94
}
95
96
97
- if (props.readonly) {
98
- watch(
99
- () => props.value,
100
- (value) => {
101
- editorInstance.setValue(value || '')
102
- monaco.editor.setModelLanguage(editorInstance.getModel()!, lang.value)
103
- }
104
- )
105
- } else {
+ watch(
+ () => props.value,
+ (value) => editorInstance.setValue(value || ''),
+ { immediate: true }
+ )
+
+ watch(lang, (lang) =>
+ monaco.editor.setModelLanguage(editorInstance.getModel()!, lang)
106
107
+ if (!props.readonly) {
108
watch(
109
() => props.filename,
110
(_, oldFilename) => {
0 commit comments