mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-08-31 11:23:26 +08:00
feat(stage): 提供tmagicRuntimeReady message事件通知
This commit is contained in:
parent
23776299a7
commit
def0e3ef8d
@ -230,11 +230,11 @@ export default class StageCore extends EventEmitter {
|
|||||||
* 挂载Dom节点
|
* 挂载Dom节点
|
||||||
* @param el 将stage挂载到该Dom节点上
|
* @param el 将stage挂载到该Dom节点上
|
||||||
*/
|
*/
|
||||||
public mount(el: HTMLDivElement): void {
|
public async mount(el: HTMLDivElement) {
|
||||||
this.container = el;
|
this.container = el;
|
||||||
const { mask, renderer } = this;
|
const { mask, renderer } = this;
|
||||||
|
|
||||||
renderer.mount(el);
|
await renderer.mount(el);
|
||||||
mask.mount(el);
|
mask.mount(el);
|
||||||
|
|
||||||
this.emit('mounted');
|
this.emit('mounted');
|
||||||
|
@ -121,5 +121,12 @@ export default class StageRender extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.emit('onload');
|
this.emit('onload');
|
||||||
|
|
||||||
|
this.contentWindow.postMessage(
|
||||||
|
{
|
||||||
|
tmagicRuntimeReady: true,
|
||||||
|
},
|
||||||
|
'*',
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user