diff --git a/src/components/nav/ANavLink.vue b/src/components/nav/ANavLink.vue index 3a09b071bf4f30ab6922c35efb307dcc7184b3a9..787884ac5ec6b748f0080025394e504b311a8c41 100644 --- a/src/components/nav/ANavLink.vue +++ b/src/components/nav/ANavLink.vue @@ -1,7 +1,7 @@ <template> <RouterLink v-if="route" - active-class="has-active-child" + :active-class="`${activeIfChildActive ? 'is-active' : ''} has-active-child`" exact-active-class="is-active" :class="linkClasses" :to="route" @@ -20,7 +20,7 @@ import { computed } from 'vue' const linkClasses = 'a-nav-link tw-no-underline tw-block tw-py-3 tw-px-6' -const props = defineProps<{ route?: Route; testId?: string }>() +const props = defineProps<{ route?: Route; testId?: string; activeIfChildActive?: boolean }>() const attrs = computed(() => ({ 'data-testid': props.testId })) </script>