Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout.js文件中window.postMessage是否有存在必要 #163

Open
eeyyyy opened this issue Jul 6, 2023 · 1 comment
Open

layout.js文件中window.postMessage是否有存在必要 #163

eeyyyy opened this issue Jul 6, 2023 · 1 comment

Comments

@eeyyyy
Copy link

eeyyyy commented Jul 6, 2023

image
image
在写microApp中遇到两个子应用同时加载词云组件时,只有第一个能加载成功,排查之后发现第二个子应用不会触发监听的 message 消息,尝试将post Message修改为普通的 setTimeout之后,发现两个应用都有成功加载词云组件,所以我有些疑惑为什么需要写 window.postMessage 来发送消息,谢谢解惑 。
另外项目中使用到 webpack-dev-server 其中 sendMessage.js 文件会一直发送 postMassage消息,这会导致第一个应用的词云组件监听 message消息的回调一直触发。

@yqlzhijie
Copy link

老兄,在microApp上使用这个组件,还做了什么配置吗?
我子应用没问题,放到微服务下显示不出来,有时间麻烦给解答下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants