1212 ref =" tabLinkElements"
1313 :to =" query ? (link.href ? `?${query}=${link.href}` : '?') : link.href"
1414 class =" button-animation z-[1] flex flex-row items-center gap-2 px-4 py-2 focus:rounded-full"
15- :class =" {
16- 'text-button-textSelected': currentActiveIndex === index && !subpageSelected,
17- 'text-contrast':
18- (currentActiveIndex === index && subpageSelected) || currentActiveIndex !== index,
19- }"
2015 >
21- <component :is =" link.icon" v-if =" link.icon" class =" size-5" />
22- <span class =" text-nowrap" >{{ link.label }}</span >
16+ <component
17+ :is =" link.icon"
18+ v-if =" link.icon"
19+ class =" size-5"
20+ :class =" {
21+ 'text-brand': currentActiveIndex === index && !subpageSelected,
22+ 'text-secondary': currentActiveIndex !== index || subpageSelected,
23+ }"
24+ />
25+ <span class =" text-nowrap text-contrast" >{{ link.label }}</span >
2326 </NuxtLink >
2427 </template >
2528 <template v-else >
2932 :key =" link.href"
3033 ref =" tabLinkElements"
3134 class =" button-animation z-[1] flex flex-row items-center gap-2 px-4 py-2 hover:cursor-pointer focus:rounded-full"
32- :class =" {
33- 'text-button-textSelected': currentActiveIndex === index && !subpageSelected,
34- 'text-contrast':
35- (currentActiveIndex === index && subpageSelected) || currentActiveIndex !== index,
36- }"
3735 @click =" emit('tabClick', index, link)"
3836 >
39- <component :is =" link.icon" v-if =" link.icon" class =" size-5" />
40- <span class =" text-nowrap" >{{ link.label }}</span >
37+ <component
38+ :is =" link.icon"
39+ v-if =" link.icon"
40+ class =" size-5"
41+ :class =" {
42+ 'text-brand': currentActiveIndex === index && !subpageSelected,
43+ 'text-secondary': currentActiveIndex !== index || subpageSelected,
44+ }"
45+ />
46+ <span class =" text-nowrap text-contrast" >{{ link.label }}</span >
4147 </div >
4248 </template >
4349 <div
5864</template >
5965
6066<script setup lang="ts">
67+ import type { Component } from ' vue'
6168import { computed , nextTick , onMounted , ref , watch } from ' vue'
6269
6370const route = useNativeRoute ()
@@ -66,7 +73,7 @@ interface Tab {
6673 label: string
6774 href: string
6875 shown? : boolean
69- icon? : string
76+ icon? : Component
7077 subpages? : string []
7178}
7279
0 commit comments