VUE路由懒加载的方式
方式一:结合Vue的异步组件和Webpack的代码分析(了解~)
const Home = resolve => { require.ensure(['../components/Home.vue'], () => { resolve(require('../components/Home.vue'))})}
方式二:AMD写法
const About = resolve => require(['../components/About.vue'], resolve);
方式三:在ES6中,我们可以有更加简单的方法来组织Vue异步组件和Webpack的代码分割(推荐使用)
const Home = () => import('../components/Home.vue')