index.vue 911 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <a-card :title="title" >
  3. <a-row justify="center">
  4. <a-col
  5. v-for="item in list"
  6. :key="item.key"
  7. :xs="12" :sm="12" :md="6" :lg="8" :xl="4"
  8. >
  9. <div class="statistic" >
  10. <span class="count" :style="{color: item.color}" >{{item.value}}</span>
  11. <span>{{item.unit}}</span>
  12. </div>
  13. <div class="label" >
  14. {{item.label}}
  15. </div>
  16. </a-col>
  17. </a-row>
  18. </a-card>
  19. </template>
  20. <script lang='ts' setup >
  21. interface IProps {
  22. title: string,
  23. list: {value: string | number, key?: string, label: string, color: string, unit: string }[]
  24. }
  25. const props = defineProps<IProps>()
  26. </script>
  27. <style lang='less' scoped >
  28. @import '~@/styles/theme.less';
  29. .statistic {
  30. color: @sublabel-color;
  31. .count {
  32. font-size: 48px;
  33. margin-right: 10px;
  34. }
  35. }
  36. .label {
  37. font-size: 18px;
  38. color: @sublabel-color;
  39. }
  40. </style>