Skip to content

LucasZheng/vue-directive-count-to

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue-Directive-Count-To

Vue-Directive-Count-To is a lightweight directive for VUE, you can use it in any HTML tags.

Installation

$ npm install vue-directive-count-to

Usage

Import this library and registe it in your main.js

import countTo from 'vue-directive-count-to'

Vue.directive('countTo', countTo)

In your VUE component, you can use this directive as follow:

<div v-countTo="countNum"></div>

countNum is a static number either a variable number requested from backend. The default animation time is 3000 milliseconds.

If you want to change the animation time, you can set this directive like this:

<div v-countTo:time.5000="countNum"></div>

About

A custom directive of countTo for VUE.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published