Skip to content

Commit 70c929c

Browse files
authored
Fix AppSidebar type error by using imported type and correct property names in NavMain (#27)
1 parent 0340f95 commit 70c929c

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

resources/js/components/NavMain.vue

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
<script setup lang="ts">
22
import { SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar';
3-
import { type SharedData } from '@/types';
3+
import { type SharedData, type NavItem } from '@/types';
44
import { Link, usePage } from '@inertiajs/vue3';
5-
import type { Component } from 'vue';
6-
7-
interface NavItem {
8-
title: string;
9-
url: string;
10-
icon: Component;
11-
}
125
136
defineProps<{
147
items: NavItem[];
@@ -22,8 +15,8 @@ const page = usePage<SharedData>();
2215
<SidebarGroupLabel>Platform</SidebarGroupLabel>
2316
<SidebarMenu>
2417
<SidebarMenuItem v-for="item in items" :key="item.title">
25-
<SidebarMenuButton as-child :is-active="item.url === page.url">
26-
<Link :href="item.url">
18+
<SidebarMenuButton as-child :is-active="item.href === page.url">
19+
<Link :href="item.href">
2720
<component :is="item.icon" />
2821
<span>{{ item.title }}</span>
2922
</Link>

0 commit comments

Comments
 (0)