card.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <el-row :gutter="16">
  3. <el-col :span="8">
  4. <div class="statistic-card">
  5. <el-statistic :value="98500">
  6. <template #title>
  7. <div style="display: inline-flex; align-items: center">
  8. Daily active users
  9. <el-tooltip
  10. effect="dark"
  11. content="Number of users who logged into the product in one day"
  12. placement="top"
  13. >
  14. <el-icon style="margin-left: 4px" :size="12">
  15. <Warning />
  16. </el-icon>
  17. </el-tooltip>
  18. </div>
  19. </template>
  20. </el-statistic>
  21. <div class="statistic-footer">
  22. <div class="footer-item">
  23. <span>than yesterday</span>
  24. <span class="green">
  25. 24%
  26. <el-icon>
  27. <CaretTop />
  28. </el-icon>
  29. </span>
  30. </div>
  31. </div>
  32. </div>
  33. </el-col>
  34. <el-col :span="8">
  35. <div class="statistic-card">
  36. <el-statistic :value="693700">
  37. <template #title>
  38. <div style="display: inline-flex; align-items: center">
  39. Monthly Active Users
  40. <el-tooltip
  41. effect="dark"
  42. content="Number of users who logged into the product in one month"
  43. placement="top"
  44. >
  45. <el-icon style="margin-left: 4px" :size="12">
  46. <Warning />
  47. </el-icon>
  48. </el-tooltip>
  49. </div>
  50. </template>
  51. </el-statistic>
  52. <div class="statistic-footer">
  53. <div class="footer-item">
  54. <span>month on month</span>
  55. <span class="red">
  56. 12%
  57. <el-icon>
  58. <CaretBottom />
  59. </el-icon>
  60. </span>
  61. </div>
  62. </div>
  63. </div>
  64. </el-col>
  65. <el-col :span="8">
  66. <div class="statistic-card">
  67. <el-statistic :value="72000" title="New transactions today">
  68. <template #title>
  69. <div style="display: inline-flex; align-items: center">
  70. New transactions today
  71. </div>
  72. </template>
  73. </el-statistic>
  74. <div class="statistic-footer">
  75. <div class="footer-item">
  76. <span>than yesterday</span>
  77. <span class="green">
  78. 16%
  79. <el-icon>
  80. <CaretTop />
  81. </el-icon>
  82. </span>
  83. </div>
  84. <div class="footer-item">
  85. <el-icon :size="14">
  86. <ArrowRight />
  87. </el-icon>
  88. </div>
  89. </div>
  90. </div>
  91. </el-col>
  92. </el-row>
  93. </template>
  94. <script lang="ts" setup>
  95. import {
  96. ArrowRight,
  97. CaretBottom,
  98. CaretTop,
  99. Warning,
  100. } from '@element-plus/icons-vue'
  101. </script>
  102. <style scoped>
  103. :global(h2#card-usage ~ .example .example-showcase) {
  104. background-color: var(--el-fill-color) !important;
  105. }
  106. .el-statistic {
  107. --el-statistic-content-font-size: 28px;
  108. }
  109. .statistic-card {
  110. height: 100%;
  111. padding: 20px;
  112. border-radius: 4px;
  113. background-color: var(--el-bg-color-overlay);
  114. }
  115. .statistic-footer {
  116. display: flex;
  117. justify-content: space-between;
  118. align-items: center;
  119. flex-wrap: wrap;
  120. font-size: 12px;
  121. color: var(--el-text-color-regular);
  122. margin-top: 16px;
  123. }
  124. .statistic-footer .footer-item {
  125. display: flex;
  126. justify-content: space-between;
  127. align-items: center;
  128. }
  129. .statistic-footer .footer-item span:last-child {
  130. display: inline-flex;
  131. align-items: center;
  132. margin-left: 4px;
  133. }
  134. .green {
  135. color: var(--el-color-success);
  136. }
  137. .red {
  138. color: var(--el-color-error);
  139. }
  140. </style>