Closed eric1202 closed 2 years ago
子应用设置 router.base 为dashboard 试一下呢
不行哦 // vue-router在hash模式下不支持base,可以用一个根页面进行包裹 base: window.__MICRO_APP_BASE_ROUTE__ || '/',
目前是通过监听路有变化 next({ path: '/' + currentRouter.name + currentRouter.fullPath }) 来解决的 有点不太好
Since the issue was labeled with inactive
, but no response in 7 days. This issue will be close. If you have any questions, you can comment and reply.
由于该 issue 被标记为不活跃,且 7 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
问题描述
刷新或者浏览器输入丢失路径
目标 http://localhost:8013/appname/#/order 刷新或者回车 http://localhost:8013/#/order 再刷新或者回车 http://localhost:8013/dashboard#/order 再刷新或者回车 http://localhost:8013/dashboard#/order
期望是一直都是目标url http://localhost:8013/appname/#/order
复现步骤
基座应用是history路由,子应用是hash路由,我们要跳转基座应用的my-app页面,页面中嵌入子应用,我们要展现子应用的page1页面。
那么浏览器地址应该为:域名/my-page#/page1,我们在基座中跳转my-app页面的参数为:router.push('/my-page#/page1')
此时基座应用会匹配到/my-page路径并渲染my-app页面,子应用匹配到#/page1并渲染page1页面。
环境信息