router.beforeEach((to,from,next)=>{})

全局后置钩子router.afterEach((to,from)=>{})

到达这个组件时,beforeRouteEnter:(to,from,next)=>{})

离开这个组件时,beforeRouteLeave:(to,from,next)=>{})

beforeEnter:(to,from,next)=>{})