From 387de765d357083d42af4ca21f9ecad9768e368a Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 17 Aug 2023 12:27:08 +0530 Subject: [PATCH] Fixed: issue of menu not being enabled for dynamic childRoutes(#122) --- src/components/Menu.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Menu.vue b/src/components/Menu.vue index 8e8f3f68..0df28ddb 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -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 }, @@ -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 {