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

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

Vue plugin for make number animate
https://github.com/ntnyq/vue-number-animate

animate number vue

Last synced: 4 months ago
JSON representation

Vue plugin for make number animate

Awesome Lists containing this project

README

          

# vue-number-animate

> 基于 __Vue__ 的数字滚动插件

## Usage

``` js
import 'number-animate/dist/style.css'
import NumberAnimate from 'number-animate'

Vue.use(NumberAnimate)
```

``` vue





export default {
name: 'App',
data () {
return {
number: 123456789.987654321
}
},

methods: {
finish () {
console.log(`Number animate finished`)
}
},

created () {
setInterval(() => {
const len = ~~(Math.random() * 10) + 4
this.number = Math.random() * (10 ** len)
}, 5e3)
}
}

```