From dd58c1d3a27ba48a5df050aab7c586bb9b988914 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期三, 09 四月 2025 18:01:22 +0800 Subject: [PATCH] activeTopMenuStyle --- src/stores/global.ts | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/src/stores/global.ts b/src/stores/global.ts index 336089a..4d219e0 100644 --- a/src/stores/global.ts +++ b/src/stores/global.ts @@ -136,3 +136,36 @@ handleBindWechat(result.wxcode); } }; + + +/** + * 杩斿洖涓�涓璞★紝缁� parent 璋冪敤 + * 姝ゅ璞″寘鍚涓嚱鏁� + * @returns + */ +const childCallObj = { + /** @description 娴嬭瘯鍑芥暟 */ + test: (msg: string) => { + console.log('test 鍑芥暟鏉ヨ嚜 child', msg); + }, + execute: (obj: any) => { + console.log('execute 鍑芥暟鏉ヨ嚜 child', obj); + }, +}; +export class ParentRegister { + static notify = null; + static setRegisterFunc() { + if (!window.parent) return; + (window as any).registerNotifyFunction = (notifyFunc: any) => { + ParentRegister.notify = notifyFunc; + return childCallObj; + }; + } + + static updateChildCallObj(key:string,callback:Function) { + childCallObj[key] = callback; + } +} + + +window.callObj = childCallObj; \ No newline at end of file -- Gitblit v1.9.3