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
Redirect the page through the router guard, the second time will not take effect #916
Comments
QQ20210429-170034-HD.mp4I could provide a recording screen, and I obviously triggered the jump to the My browser version: Microsoft Edge 90.0.818.49 (64 位) I'm sorry I can't provide an online demo like |
This one is a bit special because it happens only in hash mode through an interaction that is problematic by design: changing the URL manually doesn't trigger a reload. It has a few edge cases, I hope they can all be fixed. For example the same problem appear when cancelling the navigation with a |
Yes, and in some edge cases, the page changes. If necessary, I can also provide a demo, but it may be more complicated |
The repro is good. I started working on a fix |
thx |
This might be a workaround, add param router.beforeEach((to)=>{
if (to.path.includes('/login')) {
return true;
}else{
return {
path:'/login',
force: true
}
}
}) I just tested it, it work. |
Thx!!!! |
Version
4.0.6
Reproduction link
https://github.com/XingXiaoWu/ele-error
Steps to reproduce
Note:
I have 2 path,
/about
and/login
, and if url don't incluedlogin
, I will redirect to/login
code
Step:
http://localhost:8081/#/about
in your browser's address barit will redirect to
http://localhost:8081/#/login
http://localhost:8081/#/about
againWhat is expected?
the page is login,
and the browser's address bar is
http://localhost:8081/#/login
What is actually happening?
the page is login
But the browser's address bar is
http://localhost:8081/#/about
Pages also change on some micro front-end frameworks, like qiankun
The text was updated successfully, but these errors were encountered: