如题:
router.beforeEach((to, from, next) => {
if (to.matched.some(record => record.meta.requiresAuth)) {
next("/")
console.log(1)
}else {
next()
}
})
直接跳过了next("/")打印了1,不知是不是bug还是我的写法有问题。
如题:
router.beforeEach((to, from, next) => {
if (to.matched.some(record => record.meta.requiresAuth)) {
next("/")
console.log(1)
}else {
next()
}
})
直接跳过了next("/")打印了1,不知是不是bug还是我的写法有问题。
10 回答11.6k 阅读
2 回答3.1k 阅读✓ 已解决
2 回答4.1k 阅读✓ 已解决
4 回答4.6k 阅读✓ 已解决
3 回答2.7k 阅读✓ 已解决
4 回答2k 阅读✓ 已解决
3 回答1.8k 阅读✓ 已解决