We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a994387 commit 00b5aadCopy full SHA for 00b5aad
resources/js/components/Breadcrumbs.vue
@@ -10,6 +10,10 @@ interface BreadcrumbItem {
10
defineProps<{
11
breadcrumbs: BreadcrumbItem[];
12
}>();
13
+const getBreadcrumbItemLink = (item:BreadcrumbItem,defaultValue:string = '#') : string=>{
14
+ if(!item.href ) return defaultValue;
15
+ return item.type === 'route' ? route(item.href):item.href;
16
+}
17
</script>
18
19
<template>
@@ -22,7 +26,7 @@ defineProps<{
22
26
</template>
23
27
<template v-else>
24
28
<BreadcrumbLink as-child>
25
- <Link :href="item.href ?? '#'">{{ item.title }}</Link>
29
+ <Link :href="getBreadcrumbItemLink(item)">{{ item.title }}</Link>
30
</BreadcrumbLink>
31
32
</BreadcrumbItem>
0 commit comments