<div class="breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item
v-for="(item,index) in this.$router.currentRoute.matched.filter((ft,index)=>index>0)" :key="index"
:to="item.path">{
{
item.meta.name}}</el-breadcrumb-item>
</el-breadcrumb>
</div>
样式:
.breadcrumb{
margin: 20px;
background: #fff;
padding: 10px;
}
效果图: