tanghaolin
8 天以前 f4693216c0d19774d7d0587727ccc9c60cae38d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
const notifyFunc = (jsonObj: any) => {
    console.log('message from parent🚀 ~ jsonObj:', jsonObj);
    // 执行AI通知消息
};
export class ChildRegister {
    static childCallObj = null;
    static registerNotifyFunction() {
        for (let index = 0; index < window.frames.length; index++) {
            const frame = window.frames[index];
            if ((frame as any).registerNotifyFunction) {
                ChildRegister.childCallObj = (frame as any).registerNotifyFunction(notifyFunc);
                break;
            }
        }
    }
}