import Vue from "vue"; import VueRouter from "vue-router"; import Home from "@/views/Home.vue"; import application from "@/views/application/Application.vue"; Vue.use(VueRouter); const routes = [ { path: "/", name: "Home", component: Home, redirect: "/application", children: [ { path: "/application", component: application, name: "application", meta: { title: "应用中心", // requireAuth: true, // 标识该路由是否需要登录 }, }, ], }, ]; const router = new VueRouter({ routes, }); //路由守卫 router.beforeEach((to, from, next) => { next(); }); export default router;