ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 一、概述 组件懒加载是在组件需要使用的时候才加载。 ## 二、路由中懒加载 ``` 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') > })