In vue, we defined meta like this:
const router = new VueRouter({
routes: [
{
path: '/foo',
component: Foo,
children: [
{
path: 'bar',
component: Bar,
// a meta field
meta: { requiresAuth: true }
}
]
}
]
})
But how do we define meta in nuxt?
You can use vue-router
meta
as custom component property.
https://github.com/nuxt/nuxt.js/issues/1687#issuecomment-331870619
Simple example https://github.com/nuxt/nuxt.js/tree/2.x/examples/routes-meta
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With