【发布时间】:2021-10-07 11:38:47
【问题描述】:
在我的项目中,我想将组件加载为异步组件。我发现我可以使用“defineAsyncComponent”,但它只是加载默认模块。是否可以加载其他模块?比如异步加载import {ArrowLeftOutlined, UploadOutlined} from '@ant-design/icons-vue'?
const asyncBbox = defineAsyncComponent({
loader: () => new Promise((resolve) => {
if (componentName)
resolve(import('./example-label-component'));
resolve({
template: '<div>Undefined Component</div>'
})
}),
timeout: 3000
});
【问题讨论】: