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<{
88}>();
99
1010const 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+ }
1119 </script >
1220
1321<template >
1422 <SidebarGroup class =" px-2 py-0" >
1523 <SidebarGroupLabel >Platform</SidebarGroupLabel >
1624 <SidebarMenu >
1725 <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" >
1927 <Link :href =" item.href" >
2028 <component :is =" item.icon" />
2129 <span >{{ item.title }}</span >
You can’t perform that action at this time.
0 commit comments