路由需要配置出口
路由守卫
{path:'/study',component: () => import("../views/study.vue"),beforeEnter(to,from,next){let res = localStorage.getItem("data");if(res){next();}else{next("/login")}}},
自定义路由高亮的类名
const router = new VueRouter({mode: 'history',base: process.env.BASE_URL,routes,// 自定义路由高亮类名linkActiveClass: 'active',linkExactActiveClass: 'active1'})
