Advertisement

面包屑导航组件升级为多级结构

阅读量:

component-Breadcrumb面包屑组件

修改getBreadcrumb() 加了绿色的部分

const matched = this.$route.matched.filter(item => item?.meta?.title);

const firstItem = matched.length > 0 ? matched[0] : undefined;

if (!this.isDashboard(firstItem)) {
matched.unshift({...[
{ path: '/deployment', meta: { title: 'deployment' }}
].concat(matched)})
}

if (matched.length > 1) {
const insertPosition = matched.length - 1;

let parentNode = matched[insertPosition].meta.parent;

while (parentNode !== undefined) {

复制代码
  const routeNode = this.$router.resolve(parentNode).route;

  match

全部评论 (0)

还没有任何评论哟~