Vue路由拦截

router.beforeEach((to, from, next) => {
    //拦截指定路由
    if(to.path === '/home'){
        //todo
    }else{
        scrollTo(0, 0);
        next();
    }
})

猜你喜欢

转载自www.cnblogs.com/223zzm/p/11747116.html