Giter Site home page Giter Site logo

ps-cristopher / vue3-autocounter Goto Github PK

View Code? Open in Web Editor NEW
73.0 2.0 8.0 30.63 MB

This is a lightweight Vue 3 component made with TypeScript to quickly create an animation that shows an automatic count of any quantity in any duration, counting up or down.

Home Page: https://vue3autocounter.cristopherps.dev/

License: MIT License

JavaScript 36.83% TypeScript 14.00% Vue 49.17%
vuejs vue3 vue3-typescript ui-components javascript open-source typescript webcomponents

vue3-autocounter's Introduction

Vue3 Autocounter

View Demo | Full Docs

Description

A lightweight Vue 3 component made with TypeScript, you can use it to create an animation that shows an automatic count for any quantity with a specified duration, it can be used for counting up and down.

Installation

You can install it easily with NPM.

npm install vue3-autocounter

Usage

Add the vue3-autocounter to your main.js for a global import:

import { createApp } from 'vue';
import Vue3Autocounter from 'vue3-autocounter';
import App from './App.vue';

createApp(App)
.component('vue3-autocounter', Vue3Autocounter)
.mount('#app'); 

If you prefer yo can import it directly in your Single File Component:

import { defineComponent } from 'vue';
import Vue3autocounter from 'vue3-autocounter';

export default defineComponent({
  name: 'Demo',
  components: {
    'vue3-autocounter': Vue3autocounter
  }
});   

Finally you can use it on your template:

<template>
  <vue3-autocounter ref='counter' :startAmount='0' :endAmount='2021' :duration='3' prefix='$' suffix='USD' separator=',' decimalSeparator='.' :decimals='2' :autoinit='true' @finished='alert(`Counting finished!`)'/>
</template>

Go to full documentation with properties, events and methods specifications.

Support

Send me an email to [email protected]. You can also send me a direct message on twitter @ps_cristopher.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Contributors

Made with contributors-img.

License

MIT License © 2021 Cristopher PS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.