[TOC]
### 路由独享守卫
* [ ] 作用:拦截当前访问路由的操作
* [ ] 示例:
```
import Home from '@/views/Home.vue'
export default [
{
path: '/',
name: 'home',
component: Home
},
{
path: '/about',
name: 'about',
component: () => import('@/views/About.vue'),
/**
*@params to 当前路由对象
*@params from 上一次访问的路由对象
*@params next 向下执行
*/
beforeEnter: (to, from, next) => {
}
},
{
path: '/login',
name: 'login',
component: () => import('@/views/Login.vue')
}
]
```