Blame view

src/views/dashboard/analysis/components/GrowCard.vue 1.12 KB
1
<template>
Vben authored
2
3
4
5
  <div class="md:flex">
    <template v-for="(item, index) in growCardList" :key="item.title">
      <Card
        size="small"
6
        :loading="loading"
Vben authored
7
        :title="item.title"
8
9
        class="md:w-1/4 w-full !md:mt-0"
        :class="{ '!md:mr-4': index + 1 < 4, '!mt-4': index > 0 }"
Vben authored
10
11
12
      >
        <template #extra>
          <Tag :color="item.color">{{ item.action }}</Tag>
13
        </template>
Vben authored
14
15
        <div class="py-4 px-4 flex justify-between items-center">
Vben authored
16
17
18
19
20
21
22
23
24
25
          <CountTo prefix="$" :startVal="1" :endVal="item.value" class="text-2xl" />
          <Icon :icon="item.icon" :size="40" />
        </div>

        <div class="p-2 px-4 flex justify-between">
          <span>总{{ item.title }}</span>
          <CountTo prefix="$" :startVal="1" :endVal="item.total" />
        </div>
      </Card>
    </template>
26
27
  </div>
</template>
28
<script lang="ts" setup>
Vben authored
29
30
31
32
  import { CountTo } from '/@/components/CountTo/index';
  import { Icon } from '/@/components/Icon';
  import { Tag, Card } from 'ant-design-vue';
  import { growCardList } from '../data';
33
34
35
36
37
38

  defineProps({
    loading: {
      type: Boolean,
    },
  });
39
</script>