StatisticBox.vue 1.34 KB
<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) }}{{ item.unit }}</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 1.04vw;
    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;
  }
}
</style>