GrowCard.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <div class="md:flex">
  3. <template v-for="(item, index) in growCardList" :key="item.title">
  4. <Card
  5. size="small"
  6. :loading="loading"
  7. :title="item.title"
  8. class="md:w-1/4 w-full !md:mt-0 !mt-4"
  9. :class="[index + 1 < 4 && '!md:mr-4']"
  10. :canExpan="false"
  11. >
  12. <template #extra>
  13. <Tag :color="item.color">{{ item.action }}</Tag>
  14. </template>
  15. <div class="py-4 px-4 flex justify-between">
  16. <CountTo prefix="$" :startVal="1" :endVal="item.value" class="text-2xl" />
  17. <Icon :icon="item.icon" :size="40" />
  18. </div>
  19. <div class="p-2 px-4 flex justify-between">
  20. <span>总{{ item.title }}</span>
  21. <CountTo prefix="$" :startVal="1" :endVal="item.total" />
  22. </div>
  23. </Card>
  24. </template>
  25. </div>
  26. </template>
  27. <script lang="ts" setup>
  28. import { CountTo } from '/@/components/CountTo/index';
  29. import { Icon } from '/@/components/Icon';
  30. import { Tag, Card } from 'ant-design-vue';
  31. import { growCardList } from '../data';
  32. defineProps({
  33. loading: {
  34. type: Boolean,
  35. },
  36. });
  37. </script>