49 lines
1.5 KiB
JavaScript
49 lines
1.5 KiB
JavaScript
import Vue from 'vue';//引入Vue对象,因为要用它的use
|
||
import Router from 'vue-router'//引入vue-router
|
||
//引入你需要配置的组件
|
||
import MyHello from '../components/MyHello.vue'
|
||
//使用路由插件
|
||
Vue.use(Router);
|
||
|
||
//配置路由
|
||
const router = new Router({
|
||
routes: [
|
||
{
|
||
path: "/hello",
|
||
component: MyHello
|
||
},
|
||
{
|
||
path: '/map',
|
||
name: 'map',
|
||
component: () => import('../pages/map.vue') //路由懒加载(按需加载)
|
||
},{
|
||
path: '/call_room',
|
||
name: 'call_room',
|
||
component: () => import('../pages/call_room.vue')
|
||
},{
|
||
path: '/hd_map',
|
||
name: 'hd_map',
|
||
component: () => import('../pages/hd_map.vue')
|
||
},{
|
||
path: '/hd_map_area',
|
||
name: 'hd_map_area',
|
||
component: () => import('../pages/hd_map_area.vue')
|
||
},{
|
||
path: '/hd_show_patrol_history',
|
||
name: 'hd_show_patrol_history',
|
||
component: () => import('../pages/hd_show_patrol_history.vue')
|
||
},{
|
||
path: '/hd_show_equipment_move_history',
|
||
name: 'hd_show_equipment_move_history',
|
||
component: () => import('../pages/hd_show_equipment_move_history.vue')
|
||
},{
|
||
path: '/hd_show_patrolTmp_history',
|
||
name: 'hd_show_patrolTmp_history',
|
||
component: () => import('../pages/hd_show_patrolTmp_history.vue')
|
||
}
|
||
]
|
||
});
|
||
|
||
//导出
|
||
export default router;
|