fix:匹配conponents路径下的子文件夹里的.vue文件

This commit is contained in:
tantao 2022-08-25 14:43:02 +08:00
parent 1ad04cf9ee
commit b50125d6f3

View File

@ -1,16 +1,16 @@
const modules = import.meta.globEager('../components/*.vue')
const modules = import.meta.globEager('../components/*/*.vue');
export default {
install(app) {
Object.keys(modules).forEach(componentPath => {
// 获取遍历的当前组件实例对象
let curComponent = modules[componentPath]?.default
let curComponent = modules[componentPath]?.default;
app.component(curComponent.name, curComponent);
})
});
}
}