birt
2025-04-13 b0530ed9211230227a8f94e394eda779d5ae5fc1
zhitan-vue/src/components/Breadcrumb/index.vue
@@ -18,10 +18,11 @@
  // only show routes with meta.title
  let matched = route.matched.filter(item => item.meta && item.meta.title);
  const first = matched[0]
  // 判断是否为首页
  if (!isDashboard(first)) {
    matched = [{ path: '/index', meta: { title: '首页' } }].concat(matched)
  }
  // 不自动添加首页到面包屑中
  // if (!isDashboard(first)) {
  //   matched = [{ path: '/index', meta: { title: '首页' } }].concat(matched)
  // }
  levelList.value = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
}
@@ -62,5 +63,19 @@
    color: #fff;
    cursor: text;
  }
  :deep(.el-breadcrumb__item) {
    .el-breadcrumb__inner {
      color: rgba(255, 255, 255, 0.8);
      &:hover {
        color: #fff;
      }
    }
    .el-breadcrumb__separator {
      color: rgba(255, 255, 255, 0.8);
    }
  }
}
</style>