Breadcrumb2.vue
1.15 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
44
45
46
47
48
49
50
51
52
53
<template>
<div class="com-bc2">
<div class="back-wrap" v-show="page.isShowBack" @click="$router.back()">
<i class="i i-back"></i>
<span class="back-text">返回</span>
<span class="sprator">|</span>
</div>
<div class="page-title">
{{ page.title }}
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
name: 'GLBreadcrumb2',
computed: {
page() {
const { id, hidden, title: pageTitle = '', name } = this.app.currentPage || {}
const isShowBack = id?.split('-').length > 2 && hidden
const title = name === 'HomeHomeIndex' ? '首页' : decodeURI(pageTitle)
return { isShowBack, title }
},
...mapGetters(['app', 'auth'])
},
methods: {}
}
</script>
<style lang="scss" scoped>
$bread-item-color: #333 !important;
.com-bc2 {
display: flex;
align-items: center;
font-weight: 600;
.back-wrap {
font-size: 12px;
color: $bread-item-color;
cursor: pointer;
i {
margin-right: 4px;
}
.sprator {
margin: 0 8px;
color: #c3c3c3;
}
}
.page-title {
font-size: 14px;
color: $bread-item-color;
}
}
</style>