JSPM

vue-directive-count-to

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 32
  • Score
    100M100P100Q50474F
  • License MIT

A custom directive of countTo for VUE.

Package Exports

  • vue-directive-count-to

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-directive-count-to) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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>