如题:
router.beforeEach((to, from, next) => {
if (to.matched.some(record => record.meta.requiresAuth)) {
next("/")
console.log(1)
}else {
next()
}
})
直接跳过了next("/")打印了1,不知是不是bug还是我的写法有问题。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
光阴似箭催人老,日月如移越少年。