mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 14:13:40 +08:00
chore: detail optimization
This commit is contained in:
@@ -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;
|
||||
|
@@ -45,6 +45,20 @@ const menu: MenuModule = {
|
||||
path: '/full-screen',
|
||||
name: '全屏',
|
||||
},
|
||||
{
|
||||
path: '/testTab',
|
||||
name: '带参Tab',
|
||||
children: [
|
||||
{
|
||||
path: '/id1',
|
||||
name: '带参tab1',
|
||||
},
|
||||
{
|
||||
path: '/id2',
|
||||
name: '带参tab2',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user