优化面包屑导航数据

This commit is contained in:
hooray 2021-11-13 10:44:12 +08:00
parent c003834bd8
commit fdd3a63f84
3 changed files with 9 additions and 12 deletions

View File

@ -37,7 +37,7 @@
<div class="breadcrumb">
<span v-for="(bc, bcIndex) in item.breadcrumb" :key="bcIndex">
{{ bc }}
<i class="el-icon-arrow-right" />
<svg-icon name="el-icon-arrow-right" />
</span>
</div>
<div class="path">{{ item.path }}</div>
@ -347,8 +347,11 @@ function scrollTo(offsetTop) {
@include text-overflow(1, true);
}
.breadcrumb {
span:last-child i {
display: none;
span {
margin-right: 5px;
&:last-child i {
display: none;
}
}
}
}

View File

@ -43,13 +43,7 @@ const breadcrumbList = computed(() => {
})
}
if (route.meta.breadcrumbNeste) {
route.meta.breadcrumbNeste.map((item, index) => {
let tmpItem = deepClone(item)
if (index != 0) {
tmpItem.path = `${route.meta.breadcrumbNeste[0].path}/${item.path}`
}
breadcrumbList.push(tmpItem)
})
breadcrumbList.push(...deepClone(route.meta.breadcrumbNeste))
}
return breadcrumbList
})

View File

@ -191,7 +191,7 @@ const actions = {
item.children = flatAsyncRoutes(item.children, [{
path: item.path,
title: item.meta.title
}])
}], item.path)
}
})
commit('setDefaultOpenedPaths', routes)
@ -224,7 +224,7 @@ const actions = {
item.children = flatAsyncRoutes(item.children, [{
path: item.path,
title: item.meta.title
}])
}], item.path)
}
})
commit('setDefaultOpenedPaths', routes)