-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
next()
callback isn't executed outside of component scope
#2037
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
Comments
@posva sorry! i somehow copied the wrong codepen link. here is the version that doesn't work: https://codepen.io/spaceemotion/pen/BaMZJXZ |
I think you’re comparing beforeEnter with beforeRouteEnter but they are different. This is not expected to work with beforeEnter |
Okay, right now i have an async process that starts when the route changes and needs to end when the new route is displayed on screen. The current way shows the overlay, removes it - and for like half a second you see the old screen thinking something's wrong. How can I achieve the |
Move that to the component options, declaring a second script if using script setup |
Okay. How would i go about doing that if the route that's being loaded has no component yet? it's an async component, so the actual rendering part takes a while. |
It should still be an option. BTW try to use the discussions or the Discord server for help |
Reproduction
https://codepen.io/spaceemotion/pen/BaMZJXZ
Steps to reproduce the bug
Expected behavior
Two messages should appear. One during the switch, and one after the component has been renderered.
Actual behavior
Only the first message gets logged.
Additional information
I was sure this worked in the past, the docs even mention my expected behavior as intended, but it doesn't seem to work:
router/packages/docs/guide/advanced/navigation-guards.md
Lines 235 to 237 in 7ed003d
The text was updated successfully, but these errors were encountered: