StatsBox.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div class="stats">
  3. <div v-for="(item, index) in statsData" :key="index" class="col">
  4. <div class="num">
  5. {{ item.value }}
  6. <span class="unit"> {{ item.unit }}</span>
  7. </div>
  8. <div class="desc">{{ item.desc }}</div>
  9. </div>
  10. </div>
  11. </template>
  12. <script setup>
  13. defineProps({
  14. statsData: {
  15. type: Array,
  16. required: true,
  17. default: () => [],
  18. },
  19. });
  20. </script>
  21. <style scoped lang="scss">
  22. .stats {
  23. display: flex;
  24. align-items: stretch;
  25. justify-content: space-between;
  26. background: rgba(33, 153, 248, 0.1);
  27. border: 1px solid rgba(33, 153, 248, 0.2);
  28. border-radius: 10px;
  29. padding: 10px 8px;
  30. font-size: 14px;
  31. margin-top: 12px;
  32. .col {
  33. flex: 1;
  34. text-align: center;
  35. .num {
  36. color: #2199f8;
  37. font-weight: 600;
  38. font-size: 16px;
  39. display: flex;
  40. align-items: center;
  41. justify-content: center;
  42. .unit {
  43. margin-left: 4px;
  44. font-size: 13px;
  45. font-weight: 400;
  46. color: rgba(0, 0, 0, 0.5);
  47. }
  48. }
  49. .desc {
  50. color: #000;
  51. margin-top: 4px;
  52. }
  53. }
  54. .col + .col {
  55. border-left: 1px solid rgba(33, 153, 248, 0.4);
  56. }
  57. }
  58. </style>