Async components 让您仅在实际需要时加载组件的代码,将其分割到一个单独的 bundle(chunk)中,按需获取。这减少了用户初始下载的 JavaScript。
定义 async component
js
import { defineAsyncComponent } from "vue";
// the component's code is only downloaded when it first renders
const HeavyChart = defineAsyncComponent(() =>
()
);
