breadcrumb 根据路由_动态面包屑组件(适合嵌套路由)

export default {

name:'breadCrumb',

data(){

return{

breadList:[], //路由集合

}

},

created(){

this.getBreadCrumb()

},

mounted(){

},

watch:{

$route(){

this.getBreadCrumb()

}

},

methods:{

//返回上一页

goBack(){

this.$router.go(-1)

},

getBreadCrumb(){

let matched=this.$route.matched

this.breadList=[{path:'/',meta:{title:'首页'}}].concat(matched)

}

}

}

.bread_crumb{

.crumb{

width:100%;

background-color: #f7f7f7;

.crumb_content{

width:1200px;

margin: 0 auto;

overflow: hidden;

.ant-breadcrumb{

height:30px;

line-height: 30px;

float: left;

a{

font-size: 14px;

color: #a1a1a1;

text-decoration: none;

}

a:hover{

color: #0169b1;

}

span:last-child{

a{

color: #0169b1;

}

}

}

.go_back{

float: right;

height:30px;

line-height: 30px;

cursor: pointer;

transition: all .4s;

font-size: 14px;

color: #a1a1a1;

padding: 0 20px;

&:hover{

color: #0169b1;

}

}

}

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值