【发布时间】:2021-01-27 17:51:49
【问题描述】:
我想用密码保护特定路线,并想像这样为每条路线添加元数据:
{
path: '/route-path',
name: 'route-name',
component: ComponentName,
meta: {
requiresAuth: true
}
}
所以我可以检查一下
router.beforeEach((to, from, next)
我可以访问 main.js 中的 router.beforeEach,但是我在哪里将 auth 标志添加到每个路由? gridsome.config.js 似乎不起作用?
【问题讨论】:
标签: vue.js authentication gridsome