vue-router异步加载
2019-02-15 本文已影响0人
TerdShow
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
export default new Router({
routes: [
{
path:'/Login',
name:'Login',
component:resolve => require(['@/components/Login'], resolve)
},
{
path: '/',
name: 'Home',
component: resolve => require(['@/components/Home'], resolve),
children:[{
path:'/',
name:'系统广播',
component:resolve => require(['@/components/System'], resolve)
},{
path:'/Skill',
name:'技能审核',
component:resolve => require(['@/components/Skill'], resolve)
},{
path:'/Chat',
name:"聊天室",
component:resolve => require(['@/components/Chat'], resolve)
}]
},
]
})