From 067654c6c48f4dd9f170c4679745838adf2d30d2 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Mon, 25 Dec 2023 13:59:01 +0300 Subject: [PATCH] Nested routes check added --- layouts/AppMenuItem.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layouts/AppMenuItem.vue b/layouts/AppMenuItem.vue index 48dc1ee11..b850bcf9b 100644 --- a/layouts/AppMenuItem.vue +++ b/layouts/AppMenuItem.vue @@ -46,7 +46,9 @@ export default { }, methods: { isActiveRootmenuItem(menuitem) { - return menuitem.children && !menuitem.children.some((item) => item.to === `/${this.$router.currentRoute.value.name}` || (item.children && item.children.some((it) => it.to === `/${this.$router.currentRoute.value.name}`))); + return ( + menuitem.children && !menuitem.children.some((item) => item.to === `/${this.$router.currentRoute.value?.name?.replace('-', '/')}` || (item.children && item.children.some((it) => it.to === `/${this.$router.currentRoute.value.name}`))) + ); } } };