mirror of
https://github.com/talktao/Vue3-Vite-Vant-TS-H5.git
synced 2025-04-06 03:57:55 +08:00
fix:匹配conponents路径下的子文件夹里的.vue文件
This commit is contained in:
parent
1ad04cf9ee
commit
b50125d6f3
@ -1,16 +1,16 @@
|
|||||||
const modules = import.meta.globEager('../components/*.vue')
|
const modules = import.meta.globEager('../components/*/*.vue');
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
install(app) {
|
install(app) {
|
||||||
Object.keys(modules).forEach(componentPath => {
|
Object.keys(modules).forEach(componentPath => {
|
||||||
|
|
||||||
// 获取遍历的当前组件实例对象
|
// 获取遍历的当前组件实例对象
|
||||||
let curComponent = modules[componentPath]?.default
|
let curComponent = modules[componentPath]?.default;
|
||||||
|
|
||||||
app.component(curComponent.name, curComponent);
|
app.component(curComponent.name, curComponent);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user