数字滚动

  1. <template>
  2. <div>{{ battery.a}}</div>
  3. </template>
  4. <script>
  5. import anime from "animejs";
  6. // Vue.use(VueAnime)
  7. export default {
  8. data() {
  9. return {
  10. battery: {a:"0"},
  11. };
  12. },
  13. created() {
  14. setTimeout(() => {
  15. anime({
  16. targets: this.battery,
  17. a: "11111",
  18. round: 1,
  19. easing: "linear",
  20. });
  21. }, 1000);
  22. },
  23. };
  24. </script>