企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 一、概述 组件懒加载是在组件需要使用的时候才加载。 ## 二、路由中懒加载 ``` 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') > })