File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,11 @@ const props = withDefaults(defineProps<Props>(), {
3232const page = usePage ();
3333const auth = computed (() => page .props .auth );
3434
35- const isCurrentRoute = (url : string ) => {
36- return page .url === url ;
37- };
35+ const isCurrentRoute = computed (() => (url : string ) => page .url === url );
3836
39- const activeItemStyles = computed (() => (url : string ) => (isCurrentRoute (url ) ? ' text-neutral-900 dark:bg-neutral-800 dark:text-neutral-100' : ' ' ));
37+ const activeItemStyles = computed (
38+ () => (url : string ) => (isCurrentRoute .value (url ) ? ' text-neutral-900 dark:bg-neutral-800 dark:text-neutral-100' : ' ' ),
39+ );
4040
4141const mainNavItems: NavItem [] = [
4242 {
@@ -125,7 +125,10 @@ const rightNavItems: NavItem[] = [
125125 {{ item.title }}
126126 </NavigationMenuLink >
127127 </Link >
128- <div class =" absolute bottom-0 left-0 h-0.5 w-full translate-y-px bg-black dark:bg-white" ></div >
128+ <div
129+ v-if =" isCurrentRoute(item.href)"
130+ class =" absolute bottom-0 left-0 h-0.5 w-full translate-y-px bg-black dark:bg-white"
131+ ></div >
129132 </NavigationMenuItem >
130133 </NavigationMenuList >
131134 </NavigationMenu >
You can’t perform that action at this time.
0 commit comments