Skip to content

Commit 534f5f2

Browse files
committed
fix: avoid using nuxt/ui types for breadcrumb item
Fixes #174
1 parent fc6c2e9 commit 534f5f2

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/runtime/nuxt/composables/useBreadcrumbItems.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { withoutTrailingSlash } from 'ufo'
22
import type { RouteMeta } from 'vue-router'
33
import type { MaybeRefOrGetter } from 'vue'
4-
import type { BreadcrumbLink } from '@nuxt/ui/dist/runtime/types'
54
import { defu } from 'defu'
5+
import type { NuxtLinkProps } from 'nuxt/app'
66
import { pathBreadcrumbSegments } from '../../pure/breadcrumbs'
77
import {
88
computed,
@@ -15,6 +15,22 @@ import {
1515
withSiteTrailingSlash,
1616
} from '#imports'
1717

18+
interface NuxtUIBreadcrumbItem extends NuxtLinkProps {
19+
label: string
20+
labelClass?: string
21+
icon?: string
22+
iconClass?: string
23+
as?: string
24+
type?: string
25+
disabled?: boolean
26+
active?: boolean
27+
exact?: boolean
28+
exactQuery?: boolean
29+
exactMatch?: boolean
30+
inactiveClass?: string
31+
[key: string]: any
32+
}
33+
1834
export interface BreadcrumbProps {
1935
/**
2036
* Generate the breadcrumbs based on a different path than the current route.
@@ -63,20 +79,17 @@ export interface BreadcrumbProps {
6379
hideRoot?: MaybeRefOrGetter<boolean>
6480
}
6581

66-
export interface BreadcrumbItemProps extends BreadcrumbLink {
82+
export interface BreadcrumbItemProps extends NuxtUIBreadcrumbItem {
6783
/** Whether the breadcrumb item represents the aria-current. */
6884
current?: boolean
6985
/**
7086
* The type of current location the breadcrumb item represents, if `isCurrent` is true.
7187
* @default 'page'
7288
*/
7389
ariaCurrent?: 'page' | 'step' | 'location' | 'date' | 'time' | boolean | 'true' | 'false'
74-
/** Whether the breadcrumb item is disabled. */
75-
disabled?: boolean
7690
to: string
7791
ariaLabel?: string
7892
separator?: boolean | string
79-
icon?: string
8093
class?: (string | string[] | undefined)[] | string
8194
/**
8295
* @internal

0 commit comments

Comments
 (0)