We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
No description provided.
The text was updated successfully, but these errors were encountered:
@mzcc666GtHb 官方例子中已经有这类demo
大体的思路,主应用左侧的菜单配置子应用的路径信息(主要是path),主应用通过 消息的形式把路径信息发送给 子应用,子应用接受之后,使用自身的router进行页面的跳转。
// 主应用通过下发data数据控制子应用跳转 microApp.setData(appName, { path: childPath })
import { EventCenterForMicroApp } from '@micro-zoe/micro-app' // @ts-ignore 因为vite子应用关闭了沙箱,我们需要为子应用appname-vite创建EventCenterForMicroApp对象来实现数据通信 window.eventCenterForAppNameVite = new EventCenterForMicroApp('appname-vite')
更多详情
// 监听基座下发的数据变化 window.eventCenterForAppNameVite.addDataListener((data: Record<string, unknown>) => { console.log('child-vite addDataListener:', data) if (data.path && typeof data.path === 'string') { data.path = data.path.replace(/^#/, '') // 当基座下发path时进行跳转 if (data.path && data.path !== router.currentRoute.value.path) { router.push(data.path as string) } } })
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: