Home

Issue: 906

Accessing the meta fields in extendedRoutes defined in nuxt config

[issue link]

I’ve been trying to get access to the meta field in this.$route in the 404.vue page component. I copied the extendedRoutes example from here and appended meta like below:

module.exports = {
  router: {
    extendRoutes (routes, resolve) {
      routes.push({
        name: 'custom',
        path: '*',
        component: resolve(__dirname, 'pages/404.vue'),
        meta: { name: 'Pumpkin', age: 19 }
      })
    }
  }
}

I’m getting undefined when we access the above name variable using meta property. Although, the vue-router documentation says we can access it correctly here

This question is available on Nuxt.js community (#c777)