vue 路由拦截器 beforeEach和afterEach

在路由跳转的时候,咱们须要一些权限判断。这个时候就须要使用路由的钩子函数。web beforeEach函数 router.beforeEach((to, from, next) => { // do something; /* must call `next` */ next(); }); to: Route: 即将要进入的目标 路由对象 from: Route: 当前导航正要离开的路由 next
相关文章
相关标签/搜索