Skip to content

Commit

Permalink
feat: multi level menu
Browse files Browse the repository at this point in the history
  • Loading branch information
shilohooo committed Jan 27, 2025
1 parent a499d07 commit 6129420
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/layouts/components/SidebarMenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
:to="MenuType.PAGE === menu.type ? menu.path : undefined"
:href="MenuType.LINK === menu.type ? menu.path : undefined"
:target="MenuType.LINK === menu.type ? '_blank' : undefined"
:inset-level="menu.level"
@click="tabStore.addTab(menu)"
>
<q-item-section v-if="menu.icon" avatar>
Expand All @@ -29,6 +28,7 @@
:icon="menu.icon"
:label="menu.label"
class="q-ma-sm"
:content-inset-level="0.2"
:header-class="
menu.children.findIndex((item) => route.path === item.path) > -1
? 'text-primary'
Expand Down
16 changes: 12 additions & 4 deletions src/router/routes/menu.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,19 @@ export const menuList: Menu[] = [
children: [
{
icon: 'people',
label: 'User',
path: '/user',
type: MenuType.PAGE,
label: 'User Management',
type: MenuType.CATALOG,
level: 1,
component: 'modules/sys/UserView',
children: [
{
icon: 'list',
label: 'User List',
type: MenuType.PAGE,
path: '/user',
level: 1,
component: 'modules/sys/UserView',
},
],
},
{
icon: 'security',
Expand Down

0 comments on commit 6129420

Please sign in to comment.