steps.vue
1.86 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<template>
<div class="shopStep">
<div class="processBox"
v-for="item in data"
:key="item.value"
:class="{last : item.value === arrLength -1}">
<div class="title">
<div class="edge-left" v-if="item.value !== 0"></div>
<div class="content"
:class="{glod : item.value <= active}">{{ item.label }}</div>
<div class="edge" v-if="item.value !== arrLength -1"
:class="{glodEdge : item.value <= active}"></div>
</div>
<div class="des"></div>
</div>
</div>
</template>
<script>
export default {
name: 'shopStep',
props: {
data: {
type: Array,
default: () => []
},
active: {
type: Number,
default: 0
}
},
data () {
return {
arrLength: 0
}
},
created () {
this.arrLength = this.data.length
}
}
</script>
<style lang="scss" scoped>
$stepHeight: 50px;
.shopStep{
display: flex;
height: $stepHeight;
overflow: hidden;
.processBox{
flex: 1;
.title{
width: 100%;
display: flex;
position: relative;
.content{
flex: 1;
color: #999999;
text-align: center;
background-color: #E5E5E5;
line-height: $stepHeight;
}
.edge{
position: relative;
z-index: 1;
width: 0;
height: 0;
border: $stepHeight/2 solid;
border-color: transparent transparent transparent #E5E5E5;
}
.edge-left{
position: absolute;
z-index: 1;
width: 0;
height: 0;
border: $stepHeight/2 solid;
border-color: transparent transparent transparent #FFF;
}
}
}
.last{
margin-right: - $stepHeight/2;
}
.glod{
color: #FFF !important;
background-color: $mainGlod !important;
}
.glodEdge{
border-color: transparent transparent transparent $mainGlod !important;
}
}
</style>