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

子应用内部路由跳转会出现先unmount然后再mount,浏览器返回按钮会返回到undefined路径 #738

Open
mimimamahaoduozi opened this issue Apr 16, 2024 · 2 comments

Comments

@mimimamahaoduozi
Copy link

主应用使用icestark给的React主应用,子应用使用icestark官方案例vite+vue应用,子应用切换路由,有时候会执行子应用的unmount,然后再重新mount,这时候再点击浏览器的返回按钮,会出现undefined路由

例如这样的错误路径:http://localhost:3333/waiterundefined

waiter是子应用的path

@ClarkXia
Copy link
Collaborator

能提供具体复现 demo 吗,官方 demo 参考 https://github.com/ice-lab/react-materials/tree/master/scaffolds

@mimimamahaoduozi
Copy link
Author

@ClarkXia
子应用:https://github.com/maoxiaoke/icestark-vite-vue
主应用:npm init ice icestark-layout @icedesign/stark-layout-scaffold

我的配置:
在主应用加入子应用
{ path: '/waiter', title: '小二平台', sandbox: true, loadScriptMode: 'import', entry: 'http://localhost:5173', }
配置侧导航:
{ name: 'home', path: '/waiter', icon: 'chart-pie', }, { name: 'list', path: '/waiter/list', icon: 'chart-pie', }

复现步骤:配置主应用侧导航包含vue子应用的home页、list页 --> 点击home页导航 --> 点击list页导航 --> 点击页面的detail按钮进入detail页面 --> 点击浏览器返回

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