Skip to main content

Routing for Vues

Vue Router is the official routing library that maps URLs to components in a single-page app. Routes are defined with paths, params and nested children, navigation guards control access, and RouterLink and useRoute handle navigation. Data fetching strategies decide whether to load before or after the route renders.

Stage: App Architecture · Part of the Vue roadmap · Last reviewed 19 November 2026

What to learn in Routing

Routing interview questions

How do navigation guards work in Vue Router?

Guards are functions that run before or after navigation, such as beforeEach globally or beforeEnter per route. They can allow, redirect or cancel navigation, which is how apps enforce login checks or load required data.

What is the difference between hash and history mode?

Hash mode puts the route after a # in the URL and needs no server setup. History mode uses clean URLs through the History API but the server must return the app's index.html for unknown paths.

Where Routing fits in the Vue roadmap

Routing belongs to the App Architecture stage (intermediate level), which takes about 19 hours. Routing and state.

Back to the full Vue roadmap