GrowCard.vue 2.45 KB
<template>
  <div class="md:flex justify-between">
    <template v-for="(item, index) in growCardList" :key="item.title">
      <div
        class="growCardItem md:w-1/3 w-full !md:mt-0 !mt-4 bg-white"
        :class="index === 0 ? '!md:ml-0' : '!md:ml-4'"
      >
        <div
          class="
            growCardItem-top
            border border-solid border-t-0 border-r-0 border-l-0 border-b-1
            dark:border-#ccc
            light:border-#F2F2F5
          "
        >
          <img :src="item.imgUrl" style="width: 90px; height: 90px" />
          <div class="growCardItem-right">
            <div class="flex justify-between ml-3">
              <div style="font-size: 26px; color: #333">{{ item.value }}</div>
              <img src="../../../../assets/images/tip.png" style="width: 20px; height: 20px" />
            </div>
            <div class="ml-3">{{ item.title }}</div>
            <div class="ml-1.5 mt-3 flex flex-nowrap" style="width: 240px" v-if="item.offLine">
              <div class="count">
                <img
                  src="../../../../assets/images/online.png"
                  style="width: 10px; height: 10px; margin-right: 4px"
                />
                在线 {{ item.onLine }}
              </div>
              <div class="count">
                <img
                  src="../../../../assets/images/offline.png"
                  style="width: 10px; height: 10px; margin-right: 4px"
                />
                离线 {{ item.offLine }}
              </div>
              <div class="count">
                <img
                  src="../../../../assets/images/inactive.png"
                  style="width: 10px; height: 10px; margin-right: 4px"
                />
                未激活 {{ item.inactive }}
              </div>
            </div>
          </div>
        </div>
        <div class="growCardItem-bottom"> 今日新增 {{ item.newDay }}</div>
      </div>
    </template>
  </div>
</template>
<script lang="ts" setup>
  import { growCardList } from '../data';
</script>

<style scoped lang="less">
  .growCardItem {
    height: 179px;
    color: #666;
    .growCardItem-top {
      display: flex;
      margin: 20px;
      padding-bottom: 10px;
      .growCardItem-right {
        width: 300px;
        .count {
          display: flex;
          font-size: 12px;
          align-items: center;
          margin-left: 8px;
        }
      }
    }
    .growCardItem-bottom {
      margin-left: 20px;
    }
  }
</style>