StatisticBox.vue
1.62 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
<!--
* @Description:
* @Author: huyue
* @Date: 2024-01-26 11:36:05
* @LastEditors: huyue
* @LastEditTime: 2024-07-10 14:27:55
-->
<template>
<div class="statistics">
<div class="statistics-item" v-for="(item, index) in list" :key="index" :style="{ width: 100 / list.length + '%' }">
<div class="statistics-top">
<div class="statistics-name">{{ item.name }}</div>
<div class="statistics-text">
{{ numAddSymbol(item.value) }}
<span class="statistics-unit">{{ item.unit }}</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'StatisticsBox',
props: {
list: {
type: Array
}
// bottomType: {
// type: String,
// default: 'default'
// }
},
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.statistics {
display: flex;
height: 8.15vh;
&-item {
width: 10.26vw;
padding: 1.48vh 2.41vw;
box-sizing: border-box;
margin-right: 0.42vw;
background-image: url(../../../assets/images/statistic-bg.png);
background-size: 100% 100%;
&:last-child {
margin-right: 0;
}
}
&-name {
font-weight: 500;
font-size: 14px;
color: #e8e8e8;
}
&-text {
font-weight: 600;
font-size: 18px;
background: linear-gradient(to right, #01a4f9, #6df5f9); /* 从左到右渐变 */
-webkit-background-clip: text; /* Safari/Chrome支持该属性 */
color: transparent; /* 将文本颜色设置为透明 */
margin-top: 1.1vh;
.statistics-unit {
font-size: 12px;
margin-left: 0.52vw;
}
}
}
</style>