vue-router路由懒加载

正常配置

import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/pages/login'
import Capture from '@/components/pages/capture'
import List from '@/components/pages/list'
import CaptureFail from '@/components/pages/capture-fail'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/capture',
      name: 'Capture',
      component: Capture
    },
    {
      path: '/list',
      name: 'List',
      component: List
    },
    {
      path: '/capture-fail',
      name: 'CaptureFail',
      component: CaptureFail
    }
  ]
})

“vue-router路由懒加载”继续阅读