Skip to content

Commit

Permalink
fix(theme): fix ineffective activeMatch configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-Asuka committed Dec 18, 2023
1 parent 0c434bf commit 80ecd6f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/client/theme-default/components/VPNavBarMenuGroup.vue
Expand Up @@ -24,17 +24,21 @@ const isChildActive = (navItem: DefaultTheme.NavItem) => {
}
const childrenActive = computed(() => isChildActive(props.item))
const menuActive = computed(() => {
const { activeMatch } = props.item
if (activeMatch)
return isActive(page.value.relativePath, activeMatch, true)
else
return childrenActive.value
})
</script>

<template>
<VPFlyout
:class="{
VPNavBarMenuGroup: true,
active: isActive(
page.relativePath,
item.activeMatch,
!!item.activeMatch
) || childrenActive
active: menuActive
}"
:button="item.text"
:items="item.items"
Expand Down

0 comments on commit 80ecd6f

Please sign in to comment.