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

beforeEach return false cause blank page when directly accessing that url #2287

Closed
a1mersnow opened this issue Jul 1, 2024 · 3 comments
Closed

Comments

@a1mersnow
Copy link

a1mersnow commented Jul 1, 2024

Reproduction

https://stackblitz.com/edit/vue3-vite-router-starter-69rngy?file=package.json

Steps to reproduce the bug

When I click the About link, it successfully forbids me from entering /about.
However, when I click the nav button, it just leaves a blank page without rendering anything.

Expected behavior

As for the document, it should redirect to the from path.

Actual behavior

Rendering nothing

Additional information

I wonder if this is in design or if there are some tech limits in implementing this feature.
If so, how should I resolve the problem?
And is using return false a bad idea?
Maybe I should return from.path

Copy link
Member

posva commented Jul 1, 2024

This is the expected behavior

@posva posva closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2024
@a1mersnow
Copy link
Author

@posva So, what if people directly access a route which is tackled by 'return false'? Isn't it a wrong case?

@a1mersnow
Copy link
Author

a1mersnow commented Jul 1, 2024

I think we should improve the documentation however.

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