diff --git a/packages/designer/src/builtin-simulator/host.ts b/packages/designer/src/builtin-simulator/host.ts index fdf26c06c..cdb7642a5 100644 --- a/packages/designer/src/builtin-simulator/host.ts +++ b/packages/designer/src/builtin-simulator/host.ts @@ -14,6 +14,7 @@ import { createModuleEventBus, IEventBus, } from '@alilc/lowcode-editor-core'; + import { ISimulatorHost, Component, @@ -265,6 +266,8 @@ export class BuiltinSimulatorHost implements ISimulatorHost(() => this.componentsAsset); this.injectionConsumer = new ResourceConsumer(() => { return { - appHelper: engineConfig.get('appHelper'), + appHelper: this._appHelper, }; }); + engineConfig.onGot('appHelper', (data) => { + // appHelper被config.set修改后触发injectionConsumer.consume回调 + this._appHelper = data; + }); + this.i18nConsumer = new ResourceConsumer(() => this.project.i18n); transactionManager.onStartTransaction(() => { @@ -384,6 +393,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost 0) { // 加载异步 Library await renderer.loadAsyncLibrary(this.asyncLibraryMap); - Object.keys(this.asyncLibraryMap).forEach(key => { + Object.keys(this.asyncLibraryMap).forEach((key) => { delete this.asyncLibraryMap[key]; }); } @@ -521,7 +531,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost 0) { // 加载异步 Library await this.renderer?.loadAsyncLibrary(this.asyncLibraryMap); - Object.keys(this.asyncLibraryMap).forEach(key => { + Object.keys(this.asyncLibraryMap).forEach((key) => { delete this.asyncLibraryMap[key]; }); } @@ -680,7 +690,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost