|
@@ -27,7 +27,7 @@ const props = defineProps({
|
|
|
})
|
|
|
const emits = defineEmits(['update:modelValue', 'change', 'editorDidMount'])
|
|
|
const monacoRef = ref<HTMLElement>()
|
|
|
-const editor = ref()
|
|
|
+const editor = shallowRef()
|
|
|
const _getValue = () => {
|
|
|
return editor.value?.getValue()
|
|
|
}
|
|
@@ -77,9 +77,8 @@ watch(
|
|
|
}
|
|
|
)
|
|
|
onBeforeUnmount(() => {
|
|
|
- if (editor.value) {
|
|
|
- editor.value.dispose()
|
|
|
- }
|
|
|
+ editor.value?.dispose()
|
|
|
+ editor.value = null
|
|
|
})
|
|
|
defineExpose({
|
|
|
getValue: _getValue
|