1.0.6 • Published 5 years ago

vue-simple-countup v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

vue-simple-countup

用vue简单封装的 CountUp.js。Vue.js component wrap for CountUp.js

简单易用、追踪了目标值变化、添加自动启动; 支持 CountUp.js 的大部分选项。

Installation

$ npm install --save vue-simple-countup

Usage

<simple-count-up ref="myCountUp" v-modle.number="endVal" :auto="!0"></simple-count-up>
import Vue from 'vue';
import SimpleCountUp from 'vue-simple-countup';
Vue.component(SimpleCountUp.name, SimpleCountUp);

export default {
  name: 'app',
  computed: {
    simpleCountUp() {
      return this.$refs.myCountUp;
    }
  },
  data() {
    return {
      endVal: 5555
    }
  },
  methods: {
    handleClick() {
      // start where you want
      this.simpleCountUp.start();
    }
  }
}

Options

PropertyDescriptiontypedefault
v-modelvalueNumberrequired
autoautostartBooleanfalse

more options see countUp.js#Options

Not Support Options

PropertyDescription
smartEasingThresholdnot support
smartEasingAmountnot support
easingFnnot support
formattingFnnot support
numeralsnot support

Methods

Method NameDescriptionExample
startstart the countUpsimpleCountUp.start(completeMethod)
pauseResumepause/resume the countUpsimpleCountUp.pauseResume()
updateupdate valuesimpleCountUp.update(6666)
resetreset the countUpsimpleCountUp.reset()
1.0.6

5 years ago

1.0.5

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago