micro-zoe / micro-app

A simple, efficient and powerful micro front-end framework. 一款简约、高效、功能强大的微前端框架
https://micro-zoe.github.io/micro-app/
MIT License
5.61k stars 570 forks source link

如何触发vue3子应用里的onActivated钩子函数 #973

Open XiaoDan12202 opened 11 months ago

XiaoDan12202 commented 11 months ago

问题描述

主应用是keep-alive的多页应用,micro-app作为主应用的一个路由组件,当切换应用触发了这个组件的onActivated/onDeactivated函数,但是micro-app绑定的项目内应用没有触发相应的钩子函数。 有尝试在在micro-app所在主应用组件的onDeactivated函数内调用setData发送事件,但是子应用并没有监听到

环境信息

github-actions[bot] commented 11 months ago

Hello @XiaoDan12202. In order to facilitate location and troubleshooting, we need you to provide a realistic GitHub repository. 您好 @XiaoDan12202, 为了方便定位和排查问题,我们需要您提供一个重现实例,请提供一个尽可能精简的 GitHub 仓库地址。

github-actions[bot] commented 11 months ago

Since the issue was labeled with Need Reproduction, but no response in 7 days. This issue will be close. If you have any questions, you can comment and reply. 由于该 issue 被标记为需要可复现步骤,却 7 天未收到回应。现关闭 issue,若有任何问题,可评论回复。

XiaoDan12202 commented 11 months ago

仓库地址:https://github.com/XiaoDan12202/test/tree/main/microapp-vite-vue3-demo

从子应用project的home页跳转到子应用form页面,home页里面的onDeactivated不会触发 image image

ZhangYC193 commented 3 months ago

请问最后有解决嘛 @XiaoDan12202