chore: detail optimization

This commit is contained in:
vben
2020-10-14 21:08:07 +08:00
parent 7437896034
commit 31e2715e67
27 changed files with 304 additions and 93 deletions

View File

@@ -107,7 +107,8 @@ export async function getFlatChildrenMenus(children: Menu[]) {
function basicFilter(routes: RouteRecordNormalized[]) {
return (menu: Menu) => {
const matchRoute = routes.find((route) => route.path === menu.path);
if (!matchRoute) return false;
if (!matchRoute) return true;
menu.icon = menu.icon || matchRoute.meta.icon;
menu.meta = matchRoute.meta;
return true;

View File

@@ -45,6 +45,20 @@ const menu: MenuModule = {
path: '/full-screen',
name: '全屏',
},
{
path: '/testTab',
name: '带参Tab',
children: [
{
path: '/id1',
name: '带参tab1',
},
{
path: '/id2',
name: '带参tab2',
},
],
},
],
},
};