fix(menu): show dashboard overview as root item
This commit is contained in:
@@ -29,7 +29,7 @@ export default function useMenuTree() {
|
||||
}
|
||||
|
||||
// leaf node
|
||||
if (element.meta?.hideChildrenInMenu || !element.children) {
|
||||
if (element.meta?.hideChildrenInMenu || !element.children?.length) {
|
||||
element.children = [];
|
||||
return element;
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ const group = (path: string, name: string, title: string, icon: string, order: n
|
||||
});
|
||||
|
||||
const routes: AppRouteRecordRaw[] = [
|
||||
{ path: '/dashboard', name: 'dashboard', component: DEFAULT_LAYOUT, redirect: '/dashboard/overview', meta: { title: '数据概述', requiresAuth: true, icon: 'icon-dashboard', order: 10, menuCode: 'dashboard' }, children: [
|
||||
{ path: '/dashboard', name: 'dashboard', component: DEFAULT_LAYOUT, redirect: '/dashboard/overview', meta: { title: '数据概览', requiresAuth: true, icon: 'icon-dashboard', order: 10, menuCode: 'dashboard', hideInMenu: true }, children: [
|
||||
{ path: 'overview', name: 'dashboard-overview', component: () => import('@/views/dashboard/DashboardPage.vue'), meta: { title: '运营概览', requiresAuth: true, menuCode: 'dashboard_overview' } },
|
||||
{ path: 'reports', name: 'dashboard-reports', component: () => import('@/views/dashboard/ReportPage.vue'), meta: { title: '订单报表', requiresAuth: true, menuCode: 'dashboard_reports' } },
|
||||
{ path: 'reports', name: 'dashboard-reports', component: () => import('@/views/dashboard/ReportPage.vue'), meta: { title: '订单报表', requiresAuth: true, menuCode: 'dashboard_overview', hideInMenu: true, activeMenu: 'dashboard-overview' } },
|
||||
] },
|
||||
group('profile', 'profile', '配送点资料', 'icon-storage', 20, [
|
||||
child('profile', 'basic', '本点资料', '/delivery_profile', 'delivery_profile'),
|
||||
|
||||
Reference in New Issue
Block a user