From 9e590c5cf73c9925f7aad562409f31c1ff273b18 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Thu, 26 Jun 2025 21:06:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(editor):=20=E6=96=B0=E5=A2=9Eprops-panel-u?= =?UTF-8?q?nmounted=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/editor/src/Editor.vue | 5 +++++ packages/editor/src/layouts/props-panel/FormPanel.vue | 7 ++++++- packages/editor/src/layouts/props-panel/PropsPanel.vue | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/Editor.vue b/packages/editor/src/Editor.vue index 2ef6d3be..36eecf6c 100644 --- a/packages/editor/src/Editor.vue +++ b/packages/editor/src/Editor.vue @@ -97,6 +97,7 @@ :extend-state="extendFormState" :disabled-show-src="disabledShowSrc" @mounted="propsPanelMountedHandler" + @unmounted="propsPanelUnmountedHandler" @form-error="propsPanelFormErrorHandler" @submit-error="propsPanelSubmitErrorHandler" > @@ -163,6 +164,7 @@ defineOptions({ const emit = defineEmits<{ 'props-panel-mounted': [instance: InstanceType]; + 'props-panel-unmounted': []; 'update:modelValue': [value: MApp | null]; 'props-form-error': [e: any]; 'props-submit-error': [e: any]; @@ -235,6 +237,9 @@ provide('eventBus', new EventEmitter()); const propsPanelMountedHandler = (e: InstanceType) => { emit('props-panel-mounted', e); }; +const propsPanelUnmountedHandler = () => { + emit('props-panel-unmounted'); +}; const propsPanelSubmitErrorHandler = (e: any) => { emit('props-submit-error', e); diff --git a/packages/editor/src/layouts/props-panel/FormPanel.vue b/packages/editor/src/layouts/props-panel/FormPanel.vue index 92d23e4e..e6c8b473 100644 --- a/packages/editor/src/layouts/props-panel/FormPanel.vue +++ b/packages/editor/src/layouts/props-panel/FormPanel.vue @@ -42,7 +42,7 @@