mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-11-10 10:28:24 +08:00
feat: 添加hiddenBreadcrumb选项 (#224)
This commit is contained in:
parent
6ee9d8f0ff
commit
6abf4ccbb3
|
@ -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}`,
|
||||
|
|
Loading…
Reference in New Issue
Block a user