Vue-router的全局钩子在跳转之前执行 router.beforeEach(function(to,form,next){ //do something }); 在跳转之后判断 router.afterEach(function(to,form){ //do something });