两段代码实现vue路由懒加载

const Foo = () => import('./Foo.vue')
const router = new VueRouter({
  routes: [
    { path: '/foo', component: Foo }
  ]
})

实际开发中截图:

 

posted @ 2019-02-21 14:38  博客小鹏鹏  阅读(177)  评论(0编辑  收藏  举报