1.Router
meta下配置title
2.创建组件
html
<script>
export default {
computed: {
breadList() {
return this.$route.matched
}
},
mounted() {
console.log('this.$route.matched ------------', this.$route.matched);
}
}
</script>
<el-breadcrumb separator-class="el-icon-s-home">
<el-breadcrumb-item class="text" v-for="item in breadList" :key="item.path" :to="item.path">
{{ item.mata.title }}
</el-breadcrumb-item>
</el-breadcrumb>
.text {
font-size: 15px;
font-weight: bold;
}