Auto expand

This commit is contained in:
Douglas Barone 2022-04-07 09:40:18 -04:00
parent 078668680b
commit 90d5b9c01a

View File

@ -8,7 +8,10 @@
nav nav
> >
<template v-if="group.groupTitle && !mini"> <template v-if="group.groupTitle && !mini">
<v-list-group :prepend-icon="group.groupIcon" :value="false"> <v-list-group
:prepend-icon="group.groupIcon"
:value="shouldShowGroup(group)"
>
<template #activator> <template #activator>
<v-list-item-title> <v-list-item-title>
<v-list-item-title>{{ group.groupTitle }}</v-list-item-title> <v-list-item-title>{{ group.groupTitle }}</v-list-item-title>
@ -57,6 +60,13 @@ import Nav from '@/mixins/Nav'
export default { export default {
name: 'NavList', name: 'NavList',
mixins: [Nav], mixins: [Nav],
methods: {
shouldShowGroup({ items }) {
return items.some(item =>
this.$route.matched.some(route => route.name === item.route.name)
)
}
},
props: { props: {
mini: { mini: {
type: Boolean, type: Boolean,