From 0942b3837f63ef17e43dc4210f04b65d40874adc Mon Sep 17 00:00:00 2001 From: rizrmd Date: Sun, 19 May 2024 13:35:04 +0700 Subject: [PATCH] fix devItems --- app/web/src/nova/vi/render/script/dev-item.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/web/src/nova/vi/render/script/dev-item.ts b/app/web/src/nova/vi/render/script/dev-item.ts index c150704a..c10e06f5 100644 --- a/app/web/src/nova/vi/render/script/dev-item.ts +++ b/app/web/src/nova/vi/render/script/dev-item.ts @@ -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;