File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,22 @@ defineProps<{
8
8
}>();
9
9
10
10
const page = usePage ();
11
+
12
+ const isActive = (item : NavItem ): boolean => {
13
+ if (typeof item .href === ' string' ) {
14
+ return item .href === page .url ;
15
+ }
16
+
17
+ return item .href ?.url === page .url ;
18
+ }
11
19
</script >
12
20
13
21
<template >
14
22
<SidebarGroup class =" px-2 py-0" >
15
23
<SidebarGroupLabel >Platform</SidebarGroupLabel >
16
24
<SidebarMenu >
17
25
<SidebarMenuItem v-for =" item in items" :key =" item.title" >
18
- <SidebarMenuButton as-child :is-active =" item.href === page.url " :tooltip =" item.title" >
26
+ <SidebarMenuButton as-child :is-active =" isActive( item) " :tooltip =" item.title" >
19
27
<Link :href =" item.href" >
20
28
<component :is =" item.icon" />
21
29
<span >{{ item.title }}</span >
You can’t perform that action at this time.
0 commit comments