Navigation Guards
Protect routes and run logic on navigation with guards.
What Are Navigation Guards?
Navigation guards let you run code before, during, or after a route change.
- Block or redirect navigation
- Check authentication
- Confirm before leaving a page
Types of Guards
There are three levels of guards:
- Global guards run for every navigation
- Per-route guards run for one specific route
- In-component guards run inside a component
All lessons in this course
- Setting Up Vue Router
- Nested and Dynamic Routes
- Navigation Guards