Vue-router的beforeEach与afterEach钩子函数实现拦截和切换动画

2018-09-10 / 6 阅读 / JS

Vue-router的全局钩子

在跳转之前执行
router.beforeEach(function(to,form,next){
//do something
});
在跳转之后判断
router.afterEach(function(to,form){
//do something
});
相关推荐