fix devItems

This commit is contained in:
rizrmd 2024-05-19 13:35:04 +07:00
parent 65642f6b11
commit 0942b3837f
1 changed files with 13 additions and 0 deletions

View File

@ -243,6 +243,19 @@ const formatChilds = (childs: (IItem & PrasiEdit)[]) => {
const result = childs.map((e) => {
const item: any = { ...e };
delete item.edit;
if (item.component?.props) {
for (const [k, v] of Object.entries(item.component.props) as any) {
if (v.content) {
v.content = formatChilds([v.content]);
}
}
}
if (item.childs) {
item.childs = formatChilds(item.childs);
}
return item;
});
return result;