Skip to content

Commit 5ff3c06

Browse files
committed
Fix sidebar sub-menu
1 parent 208d5a1 commit 5ff3c06

File tree

2 files changed

+41
-4
lines changed

2 files changed

+41
-4
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [v.1.0.7] - 04/20/2021
4+
5+
### Fixed
6+
- Sidebar sub-menu
7+
38
## [v.1.0.6] - 04/13/2021
49

510
### Update dependencies

src/components/Sidebar/Sidebar.vue

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
:key="item.title"
4444
v-model="item.model"
4545
>
46+
4647
<template v-slot:prependIcon>
4748
<v-icon size="24" class="mr-0" color="greyTint"> {{ item.icon }} </v-icon>
4849
</template>
@@ -57,6 +58,7 @@
5758
</template>
5859

5960
<v-list-item
61+
v-show="!item.type"
6062
v-for="(child, i) in item.children"
6163
:key="i"
6264
:to="child.link"
@@ -73,6 +75,30 @@
7375
</v-list-item-title>
7476
</v-list-item-content>
7577
</v-list-item>
78+
79+
<template v-if="item.type">
80+
<v-list-group
81+
v-for="(item, i) in item.children"
82+
:key="i"
83+
:value="true"
84+
no-action
85+
sub-group
86+
>
87+
<template v-slot:activator>
88+
<v-list-item-content>
89+
<v-list-item-title>{{ item.title }}</v-list-item-title>
90+
</v-list-item-content>
91+
</template>
92+
93+
<v-list-item
94+
v-for="(child, i) in item.children"
95+
:key="i"
96+
link
97+
>
98+
<v-list-item-title v-text="child.title"></v-list-item-title>
99+
</v-list-item>
100+
</v-list-group>
101+
</template>
76102
</v-list-group>
77103
<v-list-item
78104
color="primary"
@@ -328,15 +354,21 @@
328354
title: 'Menu Levels',
329355
icon: 'mdi-folder',
330356
model: false,
357+
type: 'sub-menu',
331358
children: [
332-
{ title: 'Level 1.1', icon: 'mdi-circle-small', },
359+
{ title: 'Level 1.1',
360+
icon: 'mdi-circle-small',
361+
children: [
362+
{ title: 'Level 1.2', icon: 'mdi-circle-small', link: '/extra/calendar'},
363+
{ title: 'Level 1.3', icon: 'mdi-circle-small', link: '/extra/invoice'},
364+
]},
333365
{
334-
title: 'Level 1.2',
366+
title: 'Level 2.1',
335367
icon: 'mdi-folder',
336368
model: false,
337369
children: [
338-
{ title: 'Calendar', icon: 'mdi-circle-small', link: '/extra/calendar'},
339-
{ title: 'Invoice', icon: 'mdi-circle-small', link: '/extra/invoice'},
370+
{ title: 'Level 2.2', icon: 'mdi-circle-small', link: '/extra/calendar'},
371+
{ title: 'Level 2.3', icon: 'mdi-circle-small', link: '/extra/invoice'},
340372
],
341373
},
342374
],

0 commit comments

Comments
 (0)