An open API service indexing awesome lists of open source software.

https://github.com/wangdahoo/vue-animate-number

animate-number as a vue component.
https://github.com/wangdahoo/vue-animate-number

Last synced: about 1 year ago
JSON representation

animate-number as a vue component.

Awesome Lists containing this project

README

          

# Animate Number

## [Demo](https://wangdahoo.github.io/vue-animate-number/)

## How to Use

#### install

```bash
$ npm install vue-animate-number
```

#### as a vue plugin

```js
import Vue from 'vue'
import VueAnimateNumber from 'vue-animate-number'
Vue.use(VueAnimateNumber)
```

#### examples

```html









animate!

export default {
methods: {
formatter: function (num) {
return num.toFixed(2)
},

startAnimate: function () {
this.$refs.myNum.start()
}
}
}

```

> more `easing` effects: https://github.com/jeremyckahn/shifty/blob/master/src/easing-functions.js

> more examples: https://github.com/wangdahoo/vue-animate-number/blob/master/index.html

## API
```html

```
| prop name | type | description | default | required |
|-----|-----|-----|-----|-----|
| mode | string | `auto` or `manual`, trigger animation immediately or not | `auto` | N |
| from | number | value, at which animate starts | - | Y |
| to | number | value, at which animate ends | - | Y |
| fromColor | string | start color for gradient, in hex format | - | N |
| toColor | string | end color for gradient, in hex format | - | N |
| formatter | Function | value formatter for number in every step during the animation | `parseInt` | N |
| animateEnd | Function | callback after animation | - | N |