♻️ Refactoring code. 修改面包屑路径没有最后一层的问题

This commit is contained in:
aeizzz 2023-02-15 12:33:27 +08:00
parent 229ce1f60b
commit 9e719d04c4
2 changed files with 4 additions and 0 deletions

View File

@ -90,6 +90,7 @@ const initRouteSplit = (path: string) => {
state.routeSplitFirst = `/${state.routeSplit[0]}`;
state.routeSplitIndex = 1;
getBreadcrumbList(routesList.value);
state.breadcrumbList.push(route)
if (route.name === 'home' || (route.name === 'notFound' && state.breadcrumbList.length > 1)) state.breadcrumbList.shift();
if (state.breadcrumbList.length > 0)

View File

@ -138,6 +138,9 @@ export function backEndComponent(routes: any) {
item.component = dynamicImport(dynamicViewsModules, item.path as string);
}
item.children && backEndComponent(item.children);
if(item.children){
item.redirect = item.children[0].path
}
return item;
});
}