From 7b0a476677c36f606c63825f99df7d2537fffa8d Mon Sep 17 00:00:00 2001 From: roymondchen Date: Fri, 3 Jan 2025 17:27:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(editor):=20=E9=85=8D=E7=BD=AE=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=97=B6=E5=B0=86=E6=A0=B7=E5=BC=8F=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E7=A9=BA=E9=85=8D=E7=BD=AE=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/layouts/props-panel/PropsPanel.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/layouts/props-panel/PropsPanel.vue b/packages/editor/src/layouts/props-panel/PropsPanel.vue index 0bddd14f..20c6c5dd 100644 --- a/packages/editor/src/layouts/props-panel/PropsPanel.vue +++ b/packages/editor/src/layouts/props-panel/PropsPanel.vue @@ -124,7 +124,21 @@ const submit = async (v: MNode, eventData?: ContainerChangeEventData) => { if (!v.id) { v.id = values.value.id; } - services?.editorService.update(v, { changeRecords: eventData?.changeRecords }); + + const newValue: MNode = { + ...v, + style: {}, + }; + + if (v.style) { + Object.entries(v.style).forEach(([key, value]) => { + if (value !== '' && newValue.style) { + newValue.style[key] = value; + } + }); + } + + services?.editorService.update(newValue, { changeRecords: eventData?.changeRecords }); } catch (e: any) { emit('submit-error', e); }