Skip to content

Commit

Permalink
Merge pull request #1020 from iview/2.0
Browse files Browse the repository at this point in the history
面包屑导航home页也可显示图标
  • Loading branch information
Lison committed Oct 10, 2018
2 parents 65a4d4b + fb23651 commit 7b89fca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ export const getMenuByRouter = (list, access) => {
* @returns {Array}
*/
export const getBreadCrumbList = (route, homeRoute) => {
let homeItem = { ...homeRoute, icon: homeRoute.meta.icon }
let routeMetched = route.matched
if (routeMetched.some(item => item.name === homeRoute.name)) return [homeRoute]
if (routeMetched.some(item => item.name === homeRoute.name)) return [homeItem]
let res = routeMetched.filter(item => {
return item.meta === undefined || !item.meta.hide
}).map(item => {
Expand All @@ -70,7 +71,7 @@ export const getBreadCrumbList = (route, homeRoute) => {
res = res.filter(item => {
return !item.meta.hideInMenu
})
return [Object.assign(homeRoute, { to: homeRoute.path }), ...res]
return [{...homeItem, to: homeRoute.path}, ...res]
}

export const getRouteTitleHandled = route => {
Expand Down

0 comments on commit 7b89fca

Please sign in to comment.