Merge pull request #181 from scmmishra/fix-sidebar

fix: inconsistent active link on sidebar navigation
This commit is contained in:
Kailash Nadh 2020-08-24 19:56:46 +05:30 committed by GitHub
commit 9147a921d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

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