0Pricing
Vue Academy · Lesson

Route Meta Fields and Typing

meta: { requiresAuth: true }, TypeScript declaration merging for typed meta.

What Are Route Meta Fields?

Every route can carry a meta object: arbitrary data attached to the route. It is perfect for flags like authentication requirements, allowed roles, page titles, or layout choices.

Adding Meta to a Route

Set the meta key on a route record. The values are entirely up to you.

const routes = [
  {
    path: '/dashboard',
    component: Dashboard,
    meta: { requiresAuth: true, roles: ['admin', 'editor'] }
  }
]

All lessons in this course

  1. Route Meta Fields and Typing
  2. Route Transitions and Animation
  3. Scroll Behavior Configuration
  4. Programmatic Navigation and useRouter
← Back to Vue Academy