在Vue中,我们这样定义了meta:
const router = new VueRouter({
routes: [
{
path: '/foo',
component: Foo,
children: [
{
path: 'bar',
component: Bar,
// a meta field
meta: { requiresAuth: true }
}
]
}
]
})
但是我们如何在nuxt中定义meta?
您可以将其
vue-router
meta
用作自定义组件属性。 https://github.com/nuxt/nuxt.js/issues/1687#issuecomment-331870619简单示例 https://github.com/nuxt/nuxt.js/tree/2.x/examples/routes-meta