You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.1 KiB

<template>
3 years ago
<!-- 面包屑 -->
<div class="breadcrumb">
<el-breadcrumb separator=">">
<template v-for="(item, i) in routes">
11 months ago
<el-breadcrumb-item v-if="i != routes.length - 1" :key="i">
<span @click="to(item)">{{ item.name }}</span>
</el-breadcrumb-item>
11 months ago
<el-breadcrumb-item v-else :key="i">
{{ item.name }}
</el-breadcrumb-item>
</template>
3 years ago
</el-breadcrumb>
</div>
</template>
<script>
export default {
2 years ago
props: {
routes: {
type: Array,
2 years ago
required: true
},
2 years ago
},
data () {
return {};
2 years ago
},
methods: {
to (item) {
if (item) {
this.$router.push(item.path)
} else {
this.$router.back()
}
2 years ago
}
}
};
</script>
<style lang="scss" scoped>
3 years ago
.breadcrumb {
11 months ago
margin: 4px 0 16px;
/deep/.el-breadcrumb__item {
.el-breadcrumb__inner,
.el-breadcrumb__separator {
font-weight: 400;
color: $main-color;
}
.el-breadcrumb__inner {
cursor: pointer;
}
11 months ago
&:last-child {
.el-breadcrumb__inner {
color: #0b1d30;
cursor: default;
}
}
}
3 years ago
}
</style>