2
0
mirror of https://github.com/frappe/books.git synced 2024-12-24 11:55:46 +00:00

fix: Sidebar activeGroup

This commit is contained in:
Faris Ansari 2019-11-08 16:15:40 +05:30
parent dc3b3a3836
commit 6050db3c79

View File

@ -66,7 +66,19 @@ export default {
async mounted() { async mounted() {
this.companyName = await sidebarConfig.getTitle(); this.companyName = await sidebarConfig.getTitle();
this.groups = sidebarConfig.groups; this.groups = sidebarConfig.groups;
this.activeGroup = this.groups.find(g => g.title === _('Sales'));
let currentPath = this.$router.currentRoute.fullPath;
this.activeGroup = this.groups.find(g => {
if (g.items) {
let activeItem = g.items.filter(i => i.route === currentPath);
if (activeItem.length) {
return true;
}
}
});
if (!this.activeGroup) {
this.activeGroup = this.groups[0];
}
}, },
methods: { methods: {
itemActiveClass(item) { itemActiveClass(item) {