Skip to content

Commit

Permalink
Fixed: issue of menu not being enabled for dynamic childRoutes(hotwax…
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Aug 17, 2023
1 parent 332f591 commit 387de76
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,21 @@ export default defineComponent({
{
title: "Inventory",
url: "/inventory",
childRoutes: ["/inventory-review"],
iosIcon: albumsOutline,
mdIcon: albumsOutline
},
{
title: "Purchase order",
url: "/purchase-order",
childRoutes: ["/purchase-order-review"],
iosIcon: calendar,
mdIcon: calendar
},
{
title: "Saved Mappings",
url: "/saved-mappings",
childRoutes: ["/mapping/"],
iosIcon: bookmarkOutline,
mdIcon: bookmarkOutline
},
Expand All @@ -108,11 +111,11 @@ export default defineComponent({
iosIcon: settings,
mdIcon: settings,
}
] as any;
];
const selectedIndex = computed(() => {
const path = router.currentRoute.value.path
return appPages.findIndex((screen : any) => screen.url === path || screen.childRoutes?.includes(path))
return appPages.findIndex((screen) => screen.url === path || screen.childRoutes?.includes(path) || screen.childRoutes?.some((route) => path.includes(route)))
})
return {
Expand Down

0 comments on commit 387de76

Please sign in to comment.