Skip to content

Commit 9ce0f81

Browse files
committed
feat[Breadcrumb]: add hide Breadcrumb option #1442
1 parent 49f1e5e commit 9ce0f81

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/components/Breadcrumb/index.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<template>
22
<el-breadcrumb class="app-breadcrumb" separator="/">
33
<transition-group name="breadcrumb">
4-
<el-breadcrumb-item v-for="(item,index) in levelList" v-if="item.meta.title" :key="item.path">
5-
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{ generateTitle(item.meta.title) }}</span>
4+
<el-breadcrumb-item v-for="(item,index) in levelList" v-if="item.meta.title&&item.meta.breadcrumb!==false" :key="item.path">
5+
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{
6+
generateTitle(item.meta.title) }}</span>
67
<a v-else @click.prevent="handleLink(item)">{{ generateTitle(item.meta.title) }}</a>
78
</el-breadcrumb-item>
89
</transition-group>

src/router/index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ import nestedRouter from './modules/nested'
2424
* redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb
2525
* name:'router-name' the name is used by <keep-alive> (must set!!!)
2626
* meta : {
27-
roles: ['admin','editor'] will control the page roles (you can set multiple roles)
27+
roles: ['admin','editor'] will control the page roles (you can set multiple roles)
2828
title: 'title' the name show in submenu and breadcrumb (recommend set)
29-
icon: 'svg-name' the icon show in the sidebar,
30-
noCache: true if true ,the page will no be cached(default is false)
29+
icon: 'svg-name' the icon show in the sidebar
30+
noCache: true if true, the page will no be cached(default is false)
31+
breadcrumb: false if false, the item will hidden in breadcrumb(default is true)
3132
}
3233
**/
3334
export const constantRouterMap = [

0 commit comments

Comments
 (0)