diff --git a/packages/code-generator/src/parser/SchemaParser.ts b/packages/code-generator/src/parser/SchemaParser.ts index 57cb01070..d4ea59ead 100644 --- a/packages/code-generator/src/parser/SchemaParser.ts +++ b/packages/code-generator/src/parser/SchemaParser.ts @@ -135,6 +135,27 @@ class SchemaParser implements ISchemaParser { } }); + // TODO: 不应该在出码部分解决? + // 处理 children 写在了 props 里的情况 + containers.forEach((container) => { + if (container.children) { + handleSubNodes( + container.children, + { + node: (i: IComponentNodeItem) => { + if (i.props && i.props.children && !i.children) { + i.children = i.props.children as ChildNodeType; + } + return ['']; + }, + }, + { + rerun: true, + }, + ); + } + }); + // 分析路由配置 const routes = containers .filter((container) => container.containerType === 'Page')