vue3+vite 使用defineAsyncComponent动态异步引入组件出错时的解决办法
const name = 'c1' const currentComponent = shallowRef() const components = import.meta.glob("./a/*.vue"); currentComponent.value = defineAsyncComponent(components['./a/'+name+'.vue'])
<component v-bind:is="currentComponent"></component>
参考:https://cn.vitejs.dev/guide/features.html#glob-import