breadcrumb
Gitea Actions Demo / Deploy (push) Successful in 26s

This commit is contained in:
vadim committed 2026-10-09 10:59:40 +03:00
1 parent d25ec80de8
commit 7967654988
2 files changed
+10 -7

No files matched your search

+9 -6
View File
@@ -16,19 +16,22 @@ export function useBreadcrumbs() {
const router = useRouter()
const breadcrumbs = computed<Breadcrumb[]>(() => {
const matched = route.matched.filter((record) => record.meta.breadcrumb)
const matched = route.matched.filter((record) => {
return record.meta.breadcrumb
})
return matched.map((record, index) => {
const paths = matched.map((record, index): Breadcrumb => {
const { breadcrumb } = record.meta
const title = typeof breadcrumb === 'function' ? breadcrumb(route) : (breadcrumb as string)
const isLast = index === matched.length - 1
const to =
!isLast && record.name
? router.resolve({ name: record.name, params: route.params }).path
: undefined
const to = !isLast && record.name ? router.resolve({ name: record.name, params: route.params }).path : undefined
return { title, to, disabled: isLast }
})
const value: Breadcrumb[] = []
value.push({ title: 'Home', to: '/', disabled: paths.length === 0 })
return value.concat(paths)
})
return { breadcrumbs }
+1 -1
View File
@@ -109,7 +109,7 @@ const fluid = computed(() => {
<app-breadcrumbs />
</div>
<div class="layout-content">
<slot></slot>
<slot />
</div>
</v-container>
</v-main>