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 13, 2023
1 parent d36a037 commit 29b41a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmmirror.com
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,8 @@
"resolutions": {
"typescript": "4.6.2"
},
"repository": "[email protected]:alibaba/lowcode-engine.git"
"repository": "[email protected]:alibaba/lowcode-engine.git",
"volta": {
"node": "14.17.6"
}
}
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 29b41a8

Please sign in to comment.