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.

25 lines
940 B

//处理路由compontent路径
export const replyDynamRoutesPath = (data:any) => {
return data.map(item => {
if(item.children && item.children.length > 0){
item.children.map(itemChild => {
if(itemChild.component){
const modulePath0 = itemChild.component;
itemChild.component = () => new Function(`return import('/nerv-lib/saas/view/${modulePath0}')`)();
if(itemChild.children && itemChild.children.length > 0){
itemChild.children.map(itemChildChild => {
if(itemChildChild.component){
const modulePath1 = itemChildChild.component;
itemChildChild.component = () => new Function(`return import('/@/view/${modulePath1}')`)();
}
})
}else{
itemChild.component = () => new Function(`return import('/@/view/${modulePath0}')`)();
}
}
})
}
return item;
})
}