/** * router 配置,使用路由懒加载 */ import Vue from 'vue' import Router from 'vue-router' import Store from '../store' // import HelloWorld from '@/components/HelloWorld' Vue.use(Router) let router = new Router({ // mode: 'history', routes: [ { path: '/', name: 'root', // component: () => import('@/pages/index') component: () => import('@/pages/room/detail') }, { path: '/index', name: 'index', component: () => import('@/pages/index') }, { path: '/room/list', name: 'roomList', component: () => import('@/pages/room/list') }, { path: '/room/detail', name: 'roomDetail', component: () => import('@/pages/room/detail') } ] }) export default router