feat: 添加hiddenBreadcrumb选项 (#224)

This commit is contained in:
悠静萝莉 2022-07-10 14:53:22 +08:00 committed by GitHub
parent 6ee9d8f0ff
commit 6abf4ccbb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,11 @@ const crumbs = computed(() => {
pathArray.shift();
const breadcrumbs = pathArray.reduce((breadcrumbArray, path, idx) => {
// hiddenBreadcrumb
if (route.matched[idx]?.meta?.hiddenBreadcrumb || Object.values(route.params).includes(path)) {
return breadcrumbArray;
}
breadcrumbArray.push({
path,
to: breadcrumbArray[idx - 1] ? `/${breadcrumbArray[idx - 1].path}/${path}` : `/${path}`,