From 79e4d63214782469f5b51cdbcef9de578a63728b Mon Sep 17 00:00:00 2001 From: Thorge Date: Wed, 16 Oct 2024 11:24:43 +0200 Subject: [PATCH] fix(breadcrumbs): support computed overrides (#331) --- src/runtime/nuxt/composables/useBreadcrumbItems.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/nuxt/composables/useBreadcrumbItems.ts b/src/runtime/nuxt/composables/useBreadcrumbItems.ts index e0f3645..4280d62 100644 --- a/src/runtime/nuxt/composables/useBreadcrumbItems.ts +++ b/src/runtime/nuxt/composables/useBreadcrumbItems.ts @@ -55,7 +55,7 @@ export interface BreadcrumbProps { /** * Override any of the breadcrumb items based on the index. */ - overrides?: (BreadcrumbItemProps | false | undefined)[] + overrides?: MaybeRefOrGetter<(BreadcrumbItemProps | false | undefined)[]> /** * Should the schema.org breadcrumb be generated. * @default true @@ -127,7 +127,7 @@ export function useBreadcrumbItems(options: BreadcrumbProps = {}) { } const current = withoutQuery(withoutTrailingSlash(toValue(options.path || router.currentRoute.value?.path) || rootNode)) // apply overrides - const overrides = options.overrides || [] + const overrides = toValue(options.overrides || []); const segments = pathBreadcrumbSegments(current, rootNode) .map((path, index) => { let item = {