Vue Router
Vue's official router maps URLs to nested component trees, guards every navigation and, since v5, generates typed routes from files. Interviewers probe guard order and param reuse.
on this pageshowhide
explore
- Setup & History Modes5 questions
- Param Matching & Props6 questions
- Nested & Named Views5 questions
- Links & Programmatic Navigation5 questions
- Navigation Guards5 questions
- Lazy & Runtime Routes5 questions
- Typed File Routes5 questions
questions
page 2 of 2In Vue Router 5, legacy catalogue URLs like /catalog/item/:id must keep working; when do you use a redirect record versus an alias, and what does each cost?
basics
~20 sA redirect replaces the legacy URL with the new one before any guard runs; an alias keeps the legacy URL in the address bar while rendering the target record. Redirect retires old URLs; alias serves two permanent URLs.
In Vue Router 5, the mail client's fade never plays between messages, and after adding :key="route.fullPath" the settings sidebar resets on every tab; how do keys and nesting explain both?
basics
~20 sThe same component is reused between messages, so Transition has nothing to animate until a key forces a remount. A fullPath key on the outer view remounts the layout on every child switch; key each level on what it owns.
Upgrading a Vue 2 admin app from Vue Router 3 to Vue Router 5, which router setup code breaks, and what does Vue Router 5 itself change?
basics
~20 sVue Router 4 broke the setup: new VueRouter becomes createRouter, mode and base become a history factory and its argument, onReady becomes isReady, and currentRoute becomes a ref; Vue Router 5 adds no breaks for a plain v4 app.
In Vue Router 5, what does opening `/billing/invoices` download when parent and child are lazy, and how do you bundle both together?
basics
~20 sBoth chunks, requested together: the router calls the loader of every record the navigation enters and confirms once all resolve. Later sibling visits load only the new child. Merging them into one chunk is bundler configuration.
showing 31–36 of 36