From 5b7979405e741fa6e9f4443d0371280b0819629a Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Wed, 1 Mar 2023 14:51:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8=E5=85=89=E6=A0=87=E4=B8=80=E7=9B=B4=E5=9C=A8=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=9C=80=E5=89=8D=E9=9D=A2=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MonacoEditor/index.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/MonacoEditor/index.vue b/src/components/MonacoEditor/index.vue index 21f8ba61..d748341b 100644 --- a/src/components/MonacoEditor/index.vue +++ b/src/components/MonacoEditor/index.vue @@ -75,7 +75,7 @@ watchEffect(() => { }); const insert = (val) => { - if (!instance) return + if (!instance) return; const position = instance.getPosition(); instance.executeEdits(instance.getValue(), [ { @@ -88,17 +88,19 @@ const insert = (val) => { text: val, }, ]); -} +}; -watch(() => props.modelValue, - (val) => { - instance.setValue(val) - }) +// watch( +// () => props.modelValue, +// (val) => { +// instance.setValue(val); +// }, +// ); defineExpose({ editorFormat, insert, -}) +});