count-to.vue 958 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 shadow="never">
  9. <template #header>
  10. <div class="card-header">
  11. <p class="font-medium">数字动画</p>
  12. <el-link
  13. class="mt-2"
  14. href="https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/components/count-to.vue"
  15. target="_blank"
  16. >
  17. 代码位置 src/views/components/count-to.vue
  18. </el-link>
  19. </div>
  20. </template>
  21. <ReNormalCountTo
  22. prefix="$"
  23. :duration="1000"
  24. :color="'#409EFF'"
  25. :fontSize="'2em'"
  26. :startVal="1"
  27. :endVal="1000"
  28. />
  29. <br />
  30. <ul class="flex">
  31. <ReboundCountTo
  32. v-for="(num, inx) of [1, 6, 6, 6]"
  33. :key="inx"
  34. :i="num"
  35. :blur="inx"
  36. :delay="inx + 1"
  37. />
  38. </ul>
  39. </el-card>
  40. </template>