多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## 一、概述 组件懒加载是在组件需要使用的时候才加载。 ## 二、路由中懒加载 ``` const HelloWorld = ()=>import("@/components/HelloWorld") export default new Router({ routes: [ { path: '/', name: 'HelloWorld', component:HelloWorld } ] }) ``` ## 三、实例中配置懒加载 ``` components: {       historyTab: resolve => {require(['../../component/historyTab/historyTab.vue'], resolve)},//懒加载       //historyTab: () => import('../../component/historyTab/historyTab.vue') }, ``` ## 四、全局注册异步组件 > Vue.component('mideaHeader', () => { > System.import('./component/header/header.vue') > })