buyer-fee.vue
845 Bytes
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
<template>
<div class="price-wrapper">
<div class="price-item" v-for="(item, index) in data" :key="index">
<div>{{item.promotion}}</div>
<div :class="getClass(index)">{{item.promotionAmount}}</div>
</div>
</div>
</template>
<script>
export default {
name: 'BuyerFee',
props: {
data: {
type: Array,
default() {
return [];
}
},
desc: {
type: String,
default: ''
}
},
data() {
return {};
},
methods: {
getClass(index) {
return {
red: index === (this.data.length - 1)
};
}
}
};
</script>
<style lang="scss" scoped>
.price-item {
display: flex;
font-size: 28px;
justify-content: space-between;
}
.price-item + .price-item {
margin-top: 20px;
}
.red {
font-size: 36px;
color: #d0021b;
font-weight: bold;
}
</style>