BreadcrumbBar.vue
1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<template>
<a-breadcrumb class="ant-breadcrumb" v-if="this.$route.path!=='/dashboard'&&this.$route.path!=='/finance/dashboard'">
<a-breadcrumb-item>
<router-link to="/dashboard">
<HomeOutlined/>
</router-link>
</a-breadcrumb-item>
<a-breadcrumb-item v-for="item in breadcrumb" :key="item.name">
<template v-if="item.path">
<router-link :to="item.path">
{{ item.name }}
</router-link>
</template>
<template v-else>
{{ item.name }}
</template>
</a-breadcrumb-item>
</a-breadcrumb>
</template>
<script lang="ts">
import {Component, Vue} from "vue-facing-decorator";
import {HomeOutlined} from "@ant-design/icons-vue";
@Component({
components: {HomeOutlined}
})
export default class BreadcrumbBar extends Vue {
get breadcrumb() {
return this.$route.meta.breadcrumbs;
}
}
</script>
<style lang="less" scoped>
.ant-breadcrumb {
padding: 9px 20px 1px 20px;
}
</style>