fix: inconsistent active link on sidebar navigation
This commit is contained in:
parent
0f055eacb8
commit
427fcf7efd
|
@ -32,6 +32,7 @@
|
||||||
</b-menu-item><!-- dashboard -->
|
</b-menu-item><!-- dashboard -->
|
||||||
|
|
||||||
<b-menu-item :expanded="activeGroup.lists"
|
<b-menu-item :expanded="activeGroup.lists"
|
||||||
|
:active="activeGroup.lists"
|
||||||
icon="format-list-bulleted-square" label="Lists">
|
icon="format-list-bulleted-square" label="Lists">
|
||||||
<b-menu-item :to="{name: 'lists'}" tag="router-link"
|
<b-menu-item :to="{name: 'lists'}" tag="router-link"
|
||||||
:active="activeItem.lists"
|
:active="activeItem.lists"
|
||||||
|
@ -43,6 +44,7 @@
|
||||||
</b-menu-item><!-- lists -->
|
</b-menu-item><!-- lists -->
|
||||||
|
|
||||||
<b-menu-item :expanded="activeGroup.subscribers"
|
<b-menu-item :expanded="activeGroup.subscribers"
|
||||||
|
:active="activeGroup.subscribers"
|
||||||
icon="account-multiple" label="Subscribers">
|
icon="account-multiple" label="Subscribers">
|
||||||
<b-menu-item :to="{name: 'subscribers'}" tag="router-link"
|
<b-menu-item :to="{name: 'subscribers'}" tag="router-link"
|
||||||
:active="activeItem.subscribers"
|
:active="activeItem.subscribers"
|
||||||
|
@ -54,6 +56,7 @@
|
||||||
</b-menu-item><!-- subscribers -->
|
</b-menu-item><!-- subscribers -->
|
||||||
|
|
||||||
<b-menu-item :expanded="activeGroup.campaigns"
|
<b-menu-item :expanded="activeGroup.campaigns"
|
||||||
|
:active="activeGroup.campaigns"
|
||||||
icon="rocket-launch-outline" label="Campaigns">
|
icon="rocket-launch-outline" label="Campaigns">
|
||||||
<b-menu-item :to="{name: 'campaigns'}" tag="router-link"
|
<b-menu-item :to="{name: 'campaigns'}" tag="router-link"
|
||||||
:active="activeItem.campaigns"
|
:active="activeItem.campaigns"
|
||||||
|
@ -138,6 +141,10 @@ export default Vue.extend({
|
||||||
this.activeItem = { [to.name]: true };
|
this.activeItem = { [to.name]: true };
|
||||||
if (to.meta.group) {
|
if (to.meta.group) {
|
||||||
this.activeGroup = { [to.meta.group]: true };
|
this.activeGroup = { [to.meta.group]: true };
|
||||||
|
} else {
|
||||||
|
// Reset activeGroup to collapse menu items on navigating
|
||||||
|
// to non group items from sidebar
|
||||||
|
this.activeGroup = {};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue