Skip to content
Snippets Groups Projects
Commit f46b82a3 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

feat: allow ANavLink to be active if one of their children is active

parent 8b9179c5
No related branches found
No related tags found
No related merge requests found
<template> <template>
<RouterLink <RouterLink
v-if="route" v-if="route"
active-class="has-active-child" :active-class="`${activeIfChildActive ? 'is-active' : ''} has-active-child`"
exact-active-class="is-active" exact-active-class="is-active"
:class="linkClasses" :class="linkClasses"
:to="route" :to="route"
...@@ -20,7 +20,7 @@ import { computed } from 'vue' ...@@ -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 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 })) const attrs = computed(() => ({ 'data-testid': props.testId }))
</script> </script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment