1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| 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;
|
|