Component navigation guards like beforeRouteLeave or beforeRouteUpdate will not run on page load/refresh. However, something like beforeRouteEnter will run on page load/refresh.
The navigation guard beforeEnter should also run on page load/refresh.
Hope that helps!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, I stumbled upon this issue on Stack Overflow that fits in what I'm trying to achieve: stackoverflow.com/questions/491866...
The first thing that came to my mind is to use the navigation guards to check and load the right component.
Does navigation guards work on page load/refresh?
Hi! I believe it depends on the navigation guard.
Component navigation guards like beforeRouteLeave or beforeRouteUpdate will not run on page load/refresh. However, something like beforeRouteEnter will run on page load/refresh.
The navigation guard beforeEnter should also run on page load/refresh.
Hope that helps!