I've been trying to get this feature of vue-router
to work with Nuxt.js:
https://router.vuejs.org/en/essentials/passing-props.html
By default, the produced routes don't offer a way to set the props
property.
So I've added this to my nuxt.config.js
:
router: {
extendRoutes(routes, resolve) {
// Automatically map all route params to component props:
for (const route of routes) {
route.props = /:/.test(route.path)
}
}
}
But without any luck; The props don't seem to get passed through to my page components from the router params. What am I missing?
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This feature request is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1420">#c1420</a>)</em></sub></div>