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>(), {
32
32
const page = usePage ();
33
33
const auth = computed (() => page .props .auth );
34
34
35
- const isCurrentRoute = (url : string ) => {
36
- return page .url === url ;
37
- };
35
+ const isCurrentRoute = computed (() => (url : string ) => page .url === url );
38
36
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
+ );
40
40
41
41
const mainNavItems: NavItem [] = [
42
42
{
@@ -125,7 +125,10 @@ const rightNavItems: NavItem[] = [
125
125
{{ item.title }}
126
126
</NavigationMenuLink >
127
127
</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 >
129
132
</NavigationMenuItem >
130
133
</NavigationMenuList >
131
134
</NavigationMenu >
You can’t perform that action at this time.
0 commit comments