index.vue 903 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <script setup lang="ts">
  2. import { ReNormalCountTo, ReboundCountTo } from "/@/components/ReCountTo";
  3. defineOptions({
  4. name: "CountTo"
  5. });
  6. </script>
  7. <template>
  8. <el-card>
  9. <template #header>
  10. <div class="card-header">
  11. <span class="font-medium">数字动画组件</span>
  12. </div>
  13. </template>
  14. <div class="flex items-center">
  15. <ReNormalCountTo
  16. prefix="$"
  17. :duration="1000"
  18. :color="'#409EFF'"
  19. :fontSize="'2em'"
  20. :startVal="1"
  21. :endVal="1000"
  22. />
  23. <ul class="flex ml-8">
  24. <ReboundCountTo
  25. v-for="(num, inx) of [1, 6, 6, 6]"
  26. :key="inx"
  27. :i="num"
  28. :blur="inx"
  29. :delay="inx + 1"
  30. />
  31. </ul>
  32. </div>
  33. </el-card>
  34. </template>
  35. <style lang="scss" scoped>
  36. .flex {
  37. display: flex;
  38. }
  39. :deep(.el-card) {
  40. text-align: center;
  41. margin-bottom: 10px;
  42. }
  43. </style>