0Pricing
Vue Academy · Lesson

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

  1. Setting Up Vue Router
  2. Nested and Dynamic Routes
  3. Navigation Guards
← Back to Vue Academy