如題:router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { next("/")
console.log(1)
}else { next()
}
})直接跳過了next("/")打印了1,不知是不是bug還是我的寫法有問題。
vue-router 2.0.1鉤子函數(shù)不能正常的跳轉(zhuǎn)。
桃花長相依
2018-09-06 09:10:23