Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/xlsdg/vue-odometer

Vue.js(v2.x+) component wrap for Odometer.js
https://github.com/xlsdg/vue-odometer

odometer vue vue-component vue-odometer

Last synced: 3 months ago
JSON representation

Vue.js(v2.x+) component wrap for Odometer.js

Awesome Lists containing this project

README

        

# vue-odometer

> Vue.js(v2.x+) component wrap for Odometer.js

## Installation

``` bash
$ npm install --save odometer vue-odometer
```

## Usage

``` vue

import IOdometer from 'vue-odometer';
import 'odometer/themes/odometer-theme-default.css';

export default {
name: 'view',
components: {
IOdometer
},
data() {
return {
num: 999999
};
},
mounted() {
const that = this;
setInterval(function() {
that.num += 1;
}, 3000);
}
};

.iOdometer {
font-size: 2em;
margin: 0;
}

```

## Properties

* `value` **[Number]**

Optional; `0` by defualt.

* `format` **[String]**

Optional;

* `theme` **[String]**

Optional; `default` by defualt.

* `duration` **[Number]**

Optional;

* `animation` **[String]**

Optional;

* `formatFunction` **[Function]**

Optional;

See more [Odometer.js](http://github.hubspot.com/odometer/)

## Methods

* `renderInside`
* `watchForMutations`
* `startWatchingMutations`
* `stopWatchingMutations`
* `cleanValue`
* `bindTransitionEnd`
* `resetFormat`
* `renderDigit`
* `formatDigits`
* `insertDigit`
* `addDigit`
* `addSpacer`
* `animate`
* `animateCount`
* `getDigitCount`
* `getFractionalDigitCount`
* `resetDigits`
* `animateSlide`
* `render`
* `update`

Learn more [Odometer.js](http://github.hubspot.com/odometer/)

# License

MIT