1、路由独享守卫
{
path:'/hello',
name:'Hello',
component:'Hello',
beforeEnter(to,from,next){
if(to.path='/hello'){ //要加 / ,而且不能用to.name
alert('禁止跳转')
next('hello2')
}else
}
1、路由独享守卫
{
path:'/hello',
name:'Hello',
component:'Hello',
beforeEnter(to,from,next){
if(to.path='/hello'){ //要加 / ,而且不能用to.name
alert('禁止跳转')
next('hello2')
}else
}