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
多层嵌套,第一层应用A版本是1.0.0-rc.4,子应用B版本是0.8.11,子应用B中嵌套了一个其他子应用C,A中嵌套B是search路由模式当在A中访问B中的C页面,默认不管路由怎么切换都是访问的C中默认路由,不会切换
当我把B也升级到1.0.0-rc.4,但是嵌套C是通过native路由模式,这样会导致切换的时候直接修改了A的路由,比如A的域名是https://a.xxx.com,对应B子应用的路由是https://a.xxx.com/#/b?b=/index,B中对应C子应用有两个页面 c1和c2,单独访问B时路由是https://b.xxx.com/c/c1和https://b.xxx.com/c/c2,但是在A中访问B中的C应用时,地址会变成https://a.xxx.com/c/c1#/b?b=/c/c1
The text was updated successfully, but these errors were encountered:
多层嵌套路由模式最好保持一致,否则容易导致混乱
Sorry, something went wrong.
按描述渲染的逻辑是没问题的,只有C无法切换路由不太应该,大概率还是路由没匹配上
应为B应用是0.x版本的 是不是默认就是native路由模式,因为用了keep-alive,所以在B的子应用中用了 // 创建之前更新对应的路由 const regx = new RegExp(${window.__MICRO_APP_BASE_ROUTE__}(\/.*)$) // 匹配对应的正则 const match = window.location.pathname.match(regx) // 是否匹配上对应的路由 if (match && match.length) { // 替换对应的路由 app.$router.replace({ path: match[1], query: { ...getQueryObject() } }) } 在C中获取的路由 window.location.pathname每次都是首页的地址,从而导致又重定向到了首页
${window.__MICRO_APP_BASE_ROUTE__}(\/.*)$
0.x和1.0差一个大版,相互嵌套可能会出问题,最好保持版本一致
是需要保持版本一致 路由模式一致么
是的
No branches or pull requests
问题描述
当我把B也升级到1.0.0-rc.4,但是嵌套C是通过native路由模式,这样会导致切换的时候直接修改了A的路由,比如A的域名是https://a.xxx.com,对应B子应用的路由是https://a.xxx.com/#/b?b=/index,B中对应C子应用有两个页面 c1和c2,单独访问B时路由是https://b.xxx.com/c/c1和https://b.xxx.com/c/c2,但是在A中访问B中的C应用时,地址会变成https://a.xxx.com/c/c1#/b?b=/c/c1
复现步骤
环境信息
The text was updated successfully, but these errors were encountered: