Blame view

src/views/dashboard/analysis/components/GrowCard.vue 1.24 KB
1
<template>
Vben authored
2
3
4
5
6
7
  <div class="md:flex">
    <template v-for="(item, index) in growCardList" :key="item.title">
      <Card
        size="small"
        :loading="$attrs.loading"
        :title="item.title"
8
9
        class="md:w-1/4 w-full md:!mt-0 !mt-4"
        :class="[index + 1 < 4 && 'md:!mr-4']"
Vben authored
10
11
12
13
        :canExpan="false"
      >
        <template #extra>
          <Tag :color="item.color">{{ item.action }}</Tag>
14
        </template>
Vben authored
15
16
17
18
19
20
21
22
23
24
25
26

        <div class="py-4 px-4 flex justify-between">
          <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>
27
28
29
  </div>
</template>
<script lang="ts">
Vben authored
30
  import { defineComponent } from 'vue';
31
Vben authored
32
33
34
  import { CountTo } from '/@/components/CountTo/index';
  import { Icon } from '/@/components/Icon';
  import { Tag, Card } from 'ant-design-vue';
35
Vben authored
36
  import { growCardList } from '../data';
37
  export default defineComponent({
Vben authored
38
    components: { CountTo, Tag, Card, Icon },
39
    setup() {
Vben authored
40
      return { growCardList };
41
42
43
    },
  });
</script>