美文网首页
vue-router异步加载

vue-router异步加载

作者: TerdShow | 来源:发表于2019-02-15 10:31 被阅读0次

    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)

          }]

        },

      ]

    })

    相关文章

      网友评论

          本文标题:vue-router异步加载

          本文链接:https://www.haomeiwen.com/subject/ddcpeqtx.html