You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
518 B

const modules: any = import.meta.glob("@/components/*/*.vue");
const getComponentPath = (name: string) => {
let model: any;
for (let p in modules) {
const n = modules[p].name.split("/").pop().split(".")[0];
if (n === name) {
model = p;
break;
}
}
return model;
};
export const stepComponent = (name: string) => {
let path = getComponentPath(name);
if(!path) {
path = getComponentPath("NotFound")
}
return defineAsyncComponent(modules[path]);
};