You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

animated-number-vue

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

animated-number-vue

A vue component with number animation

0.0.4
Source
npmnpm
Version published
Maintainers
1
Created
Source

animated-number-vue

A simple vue animated number for Vue2, using anime.

Usage

$ npm install animated-number-vue
# OR
$ yarn add animated-number-vue
<template>
    <animated-number 
    :value="value" 
    :formatValue="formatToPrice" 
    :duration="300"
    />
</template>
<script>
import AnimatedNumber from "animated-number-vue";

export default {
  components: {
    AnimatedNumber
  },
  data() {
    return {
      value: 1000
    };
  },
  methods: {
    formatToPrice(value) {
      return `R$ ${Number(value).toFixed(2)}`;
    }
  }
};
</script>

Props

Follwing props are used while initialization

Note : Only value is a required prop. Others are optional

Prop NameTypeDescription
value (required)[ Number, String]number that will be animated
formatValue (optional)Functiona function that will manipulate the animated value
duration (optional)Numberthe duration of animation

FAQs

Package last updated on 06 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts