GrowCard.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <div class="md:flex">
  3. <template v-for="(item, index) in list" :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 < 6 && '!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="item.unit" :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, GrowCardItem } from '../data';
  32. defineProps({
  33. loading: {
  34. type: Boolean,
  35. },
  36. list: {
  37. type: Array as PropType<Array<GrowCardItem>>,
  38. default: [],
  39. },
  40. });
  41. </script>