From 5f543da6815e30c76dc3a595b993a380043af54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sat, 24 Jun 2023 20:02:00 +0800 Subject: [PATCH] fix: don't dispose in-memory files --- src/editor/MonacoEditor.vue | 4 +-- src/monaco/Monaco.vue | 66 ++++--------------------------------- src/monaco/env.ts | 51 ++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 61 deletions(-) diff --git a/src/editor/MonacoEditor.vue b/src/editor/MonacoEditor.vue index 12e95c43..b3fe7683 100644 --- a/src/editor/MonacoEditor.vue +++ b/src/editor/MonacoEditor.vue @@ -9,7 +9,7 @@ defineProps<{ mode?: PreviewMode }>() -const emits = defineEmits<{ +const emit = defineEmits<{ (e: 'change', code: string): void }>() @@ -18,7 +18,7 @@ defineOptions({ }) const onChange = (code: string) => { - emits('change', code) + emit('change', code) } diff --git a/src/monaco/Monaco.vue b/src/monaco/Monaco.vue index 1544a48e..2b0e75c1 100644 --- a/src/monaco/Monaco.vue +++ b/src/monaco/Monaco.vue @@ -1,9 +1,3 @@ - -