Skip to content

Commit

Permalink
fix: skip parsing children when loop data is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
rainke committed Sep 14, 2023
1 parent d36a037 commit 8e0ffc9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/renderer-core/src/renderer/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ export default function baseRendererFactory(): IBaseRenderComponent {

if (schema.loop != null) {
const loop = this.__parseData(schema.loop, scope);
if (Array.isArray(loop) && loop.length === 0) return null;
const useLoop = isUseLoop(loop, this.__designModeIsDesign);
if (useLoop) {
return this.__createLoopVirtualDom(
Expand Down Expand Up @@ -710,7 +711,7 @@ export default function baseRendererFactory(): IBaseRenderComponent {
}

__getSchemaChildrenVirtualDom = (schema: IPublicTypeNodeSchema | undefined, scope: any, Comp: any, condition = true) => {
let children = condition ? getSchemaChildren(schema): null
let children = condition ? getSchemaChildren(schema) : null;

// @todo 补完这里的 Element 定义 @承虎
let result: any = [];
Expand Down

0 comments on commit 8e0ffc9

Please sign in to comment.