mirror of
https://github.com/frappe/books.git
synced 2024-12-23 11:29:03 +00:00
fix: Sidebar activeGroup
This commit is contained in:
parent
dc3b3a3836
commit
6050db3c79
@ -66,7 +66,19 @@ export default {
|
||||
async mounted() {
|
||||
this.companyName = await sidebarConfig.getTitle();
|
||||
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: {
|
||||
itemActiveClass(item) {
|
||||
|
Loading…
Reference in New Issue
Block a user