mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-19 21:06:06 +08:00
feat(editor): 配置组件时将样式中的空配置移除
This commit is contained in:
parent
9e35642879
commit
7b0a476677
@ -124,7 +124,21 @@ const submit = async (v: MNode, eventData?: ContainerChangeEventData) => {
|
|||||||
if (!v.id) {
|
if (!v.id) {
|
||||||
v.id = values.value.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) {
|
} catch (e: any) {
|
||||||
emit('submit-error', e);
|
emit('submit-error', e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user