diff --git a/packages/stage/src/StageCore.ts b/packages/stage/src/StageCore.ts index c371600f..2d67b84b 100644 --- a/packages/stage/src/StageCore.ts +++ b/packages/stage/src/StageCore.ts @@ -230,11 +230,11 @@ export default class StageCore extends EventEmitter { * 挂载Dom节点 * @param el 将stage挂载到该Dom节点上 */ - public mount(el: HTMLDivElement): void { + public async mount(el: HTMLDivElement) { this.container = el; const { mask, renderer } = this; - renderer.mount(el); + await renderer.mount(el); mask.mount(el); this.emit('mounted'); diff --git a/packages/stage/src/StageRender.ts b/packages/stage/src/StageRender.ts index 78a9f262..84c44d19 100644 --- a/packages/stage/src/StageRender.ts +++ b/packages/stage/src/StageRender.ts @@ -121,5 +121,12 @@ export default class StageRender extends EventEmitter { } this.emit('onload'); + + this.contentWindow.postMessage( + { + tmagicRuntimeReady: true, + }, + '*', + ); }; }