Skip to content

Commit

Permalink
fix: do not parse children props when condition is falsy
Browse files Browse the repository at this point in the history
  • Loading branch information
rainke committed Sep 13, 2023
1 parent 1072ff3 commit d36a037
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/renderer-core/src/renderer/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ export default function baseRendererFactory(): IBaseRenderComponent {
props.key = props.__id;
}

let child = this.__getSchemaChildrenVirtualDom(schema, scope, Comp);
let child = this.__getSchemaChildrenVirtualDom(schema, scope, Comp, condition);
const renderComp = (innerProps: any) => engine.createElement(Comp, innerProps, child);
// 设计模式下的特殊处理
if (engine && [DESIGN_MODE.EXTEND, DESIGN_MODE.BORDER].includes(engine.props.designMode)) {
Expand Down Expand Up @@ -709,8 +709,8 @@ export default function baseRendererFactory(): IBaseRenderComponent {
return [];
}

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

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

0 comments on commit d36a037

Please sign in to comment.