Merge branch fix/componentNotFound into develop

Title: fix: renderer not rendering correct components when loading components with loadAsyncLibrary api 

fix: renderer not rendering correct components when loading components with loadAsyncLibrary api

Link: https://code.aone.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/codereview/8411442
This commit is contained in:
lihao.ylh 2022-04-18 11:19:46 +08:00
commit e4ae885394
2 changed files with 9 additions and 2 deletions

View File

@ -332,7 +332,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
...this._components,
};
}
private _components: any = {};
@obx.ref private _components: any = {};
get components(): object {
// 根据 device 选择不同组件,进行响应式

View File

@ -421,7 +421,14 @@ export default function baseRendererFactory() {
if (!Comp) {
console.error(`${schema.componentName} is not found! component list is:`, components || this.props.__container?.components);
Comp = engine.getNotFoundComponent();
return engine.createElement(
engine.getNotFoundComponent(),
{
componentName: schema.componentName,
componentId: schema.id,
},
this.__getSchemaChildrenVirtualDom(schema, scope, Comp),
);
}
if (schema.hidden && (engine?.props?.designMode && engine?.props?.designMode !== 'design')) {