mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
fix: loadAsyncLibrary之后buildComponents
This commit is contained in:
parent
84a112bbc9
commit
aaec68377b
@ -260,8 +260,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
// wait 准备 iframe 内容、依赖库注入
|
||||
const renderer = await createSimulator(this, iframe, vendors);
|
||||
|
||||
// 加载异步Library
|
||||
await renderer.loadAsyncLibrary(this.asycnLibraryMap);
|
||||
|
||||
// TODO: !!! thinkof reload onloa
|
||||
|
||||
// wait 业务组件被第一次消费,否则会渲染出错
|
||||
@ -270,6 +269,9 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
// wait 运行时上下文
|
||||
await this.injectionConsumer.waitFirstConsume();
|
||||
|
||||
// 加载异步Library
|
||||
await renderer.loadAsyncLibrary(this.asycnLibraryMap);
|
||||
|
||||
// step 5 ready & render
|
||||
renderer.run();
|
||||
|
||||
|
||||
@ -111,9 +111,7 @@ export default class FunctionSetter extends PureComponent<FunctionSetterProps> {
|
||||
|
||||
parseFunctionName = (functionString: string) => {
|
||||
// 因为函数格式是固定的,所以可以按照字符换去匹配获取函数名
|
||||
const funNameStr = functionString.split('this.')[1].split('.')[0];
|
||||
|
||||
return funNameStr;
|
||||
return functionString.split('this.')[1]?.split('.')[0];
|
||||
};
|
||||
|
||||
parseFunctionParam = (functionString:string) => {
|
||||
|
||||
@ -42,7 +42,7 @@ export class SimulatorRenderer implements BuiltinSimulatorRenderer {
|
||||
if (this._libraryMap !== host.libraryMap || this._componentsMap !== host.designer.componentsMap) {
|
||||
this._libraryMap = host.libraryMap || {};
|
||||
this._componentsMap = host.designer.componentsMap;
|
||||
// this.buildComponents();
|
||||
this.buildComponents();
|
||||
}
|
||||
|
||||
// sync designMode
|
||||
@ -141,10 +141,9 @@ export class SimulatorRenderer implements BuiltinSimulatorRenderer {
|
||||
return loader.load(asset);
|
||||
}
|
||||
|
||||
async loadAsyncLibrary(asycnLibraryMap) {
|
||||
const promise = await loader.loadAsyncLibrary(asycnLibraryMap);
|
||||
async loadAsyncLibrary(asyncLibraryMap) {
|
||||
await loader.loadAsyncLibrary(asyncLibraryMap);
|
||||
this.buildComponents();
|
||||
return promise;
|
||||
}
|
||||
|
||||
private instancesMap = new Map<string, ReactInstance[]>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user