vue 数字滚动组件

js yekong

安装依赖

npm i vue-count-to --save

二次封装

<template>
  <countTo :startVal='startVal' :endVal='num' :duration='3000'></countTo>
</template>

<script>
import countTo from 'vue-count-to';

export default {
  name: "countTos",
  components: {countTo},
  props: {
    num: {
      type: Number,
      default() {
        return 0;
      }
    }
  },
  data() {
    return {
      startVal: 0,
    }
  },
  watch: {},
  mounted() {
  },
  methods: {}
}
</script>

<style lang="scss" scoped>

</style>

使用

<countTo :num="nums"></countTo>
import countTo from "@/countTo";
components: {countTo},

参数说明

wanjunshijiecom20220702WsG30Y

方法

wanjunshijiecom20220702NfZ8k3

文档说明

文档说明

喜欢