index.js 2.61 KB
import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: resolve => require(["../views/Home.vue"], resolve),
    children: [
      {
        path: "/trficcshow",
        name: "trficcShow",
        component: resolve =>
          require(["../views/trafficShow/index.vue"], resolve)
      },
      {
        path: "/behaviorshow",
        name: "behaviorshow",
        component: resolve =>
          require(["../views/behaviorShow/index.vue"], resolve)
      },
      {
        path: "/task/sceneSet",
        name: "sceneSet",
         component: resolve => require(['../views/sceneManage/index.vue'], resolve),
      },
      {
        path: "/task/taskSet",
        name: "taskSet",
         component: resolve => require(['../views/taskManage/index.vue'], resolve),
      },
      {
        path: "/search/vehicleSearch",
        name: "taskSet",
         component: resolve => require(['../views/search/vehicleSearch.vue'], resolve),
      },
      {
        path: "/search/xcycle",
        name: "xcycle",
         component: resolve => require(['../views/search/xcycle.vue'], resolve),
      },
      {
        path: "/search/pedestrian",
        name: "pedestrian",
         component: resolve => require(['../views/search/pedestrian.vue'], resolve),
      },
      {
        path: "/search/event",
        name: "event",
         component: resolve => require(['../views/search/event.vue'], resolve),
      },
      {
        path: "/search/illegal",
        name: "illegal",
         component: resolve => require(['../views/search/illegal.vue'], resolve),
      },
      {
        path: "/search/traficflow",
        name: "traficflow",
         component: resolve => require(['../views/search/traficflow.vue'], resolve),
      },{
        path: "/search/publicFlow",
        name: "publicFlow",
         component: resolve => require(['../views/search/publicFlow.vue'], resolve),
      },
    ]
  },
  {
    path: "/login",
    name: "login",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: resolve => require(["../views/Login.vue"], resolve)
  },
  {
    path: "/show",
    name: "show",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: resolve => require(["../views/Show.vue"], resolve)
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;