Giter Site home page Giter Site logo

ps-cristopher / vue3-autocounter Goto Github PK

View Code? Open in Web Editor NEW
73.0 73.0 7.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%
javascript open-source typescript ui-components vue3 vue3-typescript vuejs webcomponents

vue3-autocounter's Introduction

Cristopher_PS

🀘🏼 Hello World!

I am a software engineer helping people creating amazing web apps 🀩 πŸš€.

I'm specialized in frontend development for complex scalable web apps, being responsible for connecting the APIs services with the final user, creating awesome and interactive interfaces and components with the best implementation of UX/UI design.

I am passionate about technological innovation and digital transformation, I focus on the development and optimization of web solutions, with experience in creating several kinds of multiplatform apps like multi page apps, single page applications, progressive web applications, hybrid applications, and CMS sites as well as e-commerce. I currently perform better with TypeScript and JavaScript, using frameworks such as Hapi, Vue, Nuxt, React and Quasar for creating applications in the frontend and the backend side, years ago I was programming with Java and now I am learning Python.

My goal is to continue adding value and help transform the world by bringing people and brands to the digital age, I collaborate in their transformation through the use and creation of digital media to achieve their goals.

I also create content to help others in their process and write articles on mi Blog ✍🏼. I love photography, cinema, and videogames πŸ•ΉπŸ“Έ πŸŽ₯.

You can write me here πŸ“© [email protected]

I have a podcast in spanish called ProgramArte, you can found interesting talks about web develfopment, entrepreneurship, technology and soft skills for profesional growingπŸŽ™.

πŸ‘‰πŸΌ Visit my website and follow me on my social networks where I share the content I create to continue growing together πŸš€

vue3-autocounter's People

Contributors

gregorip02 avatar ps-cristopher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vue3-autocounter's Issues

Duration prop validator

Hi. I need to set duration to 0.5, but I get a warning that the property failed validation. I understand that it is not allowed to set the value less than 1, but it is not written anywhere.
Can you fix this please ?

my code running , but after end counting i get this error

e3-autocounter.esm.js:107 Uncaught (in promise) TypeError: this.currentAmount.toFixed is not a function
at Proxy.formatedAmount (vue3-autocounter.esm.js:107:1)
at ReactiveEffect.run (reactivity.esm-bundler.js:190:1)
at get value [as value] (reactivity.esm-bundler.js:1171:1)
at Object.get [as formatedAmount] (runtime-core.esm-bundler.js:3488:1)
at Object.get (runtime-core.esm-bundler.js:3132:1)
at Proxy.displayedAmount (vue3-autocounter.esm.js:102:1)
at ReactiveEffect.run (reactivity.esm-bundler.js:190:1)
at get value [as value] (reactivity.esm-bundler.js:1171:1)
at Object.get [as displayedAmount] (runtime-core.esm-bundler.js:3488:1)
at Object.get (runtime-core.esm-bundler.js:3132:1)
f

When the count finishes, an error is thrown

I'm using Vue 3.2.31.

I have three counters running and after they finish I get this error:

vue3-autocounter.esm.js:107 Uncaught (in promise) TypeError: this.currentAmount.toFixed is not a function
    at Proxy.formatedAmount (vue3-autocounter.esm.js:107:45)
    at ReactiveEffect.run (reactivity.esm-bundler.js:167:25)
    at ComputedRefImpl.get value [as value] (reactivity.esm-bundler.js:1101:39)
    at Object.get [as formatedAmount] (runtime-core.esm-bundler.js:2845:30)
    at Object.get (runtime-core.esm-bundler.js:6683:32)
    at Proxy.displayedAmount (vue3-autocounter.esm.js:102:36)
    at ReactiveEffect.run (reactivity.esm-bundler.js:167:25)
    at ComputedRefImpl.get value [as value] (reactivity.esm-bundler.js:1101:39)
    at Object.get [as displayedAmount] (runtime-core.esm-bundler.js:2845:30)
    at Object.get (runtime-core.esm-bundler.js:6683:32)

Start the animation from the previous data

Describe

After the instance is created, the animation will restart from startAmount every time the endAmount changes.

Suggested solution

Add a prop to control whether the animation starts from the previous endAmount.

Wrong validation of 'duration' prop

Hello!
There is a text in documentation for property 'duration':

This the counting duration in seconds, it must be an integer or decimal positive.

but when I set component like so

<AutoCounter :duration="0.5" ... />

there is a warning in console:

[Vue warn]: Invalid prop: custom validator check failed for prop "duration".

Component seems to be working fine though, but having multiple instances of it on single page makes a mess in the console

No exported TypeScript interface

We need an exported TypeScript interface named something like Vue3Autocounter that we can import and use for the TypeScript template ref definition.

Currently there is no exported interface for us to use. Or at least none that I could find.

For example:

<template>
  <vue3autocounter ref='counter' :startAmount='0' :endAmount='2021' :duration='3' '/>
  <button @click='handleClick'>Start counting</button>
</template>

<script setup lang="ts">
// Import everything
import Vue3autocounter from "vue3-autocounter";

// Define the template ref
const counter = ref<Vue3Autocounter | null>(null);

// Call the start method
const handleClick = () => {
  counter.start();
}
</script>

Here I am using Vue3Autocounter in const counter = ref<Vue3Autocounter | null>(null) as an example. But actually that example will not work because Vue3Autocounter was just made up for illustration purposes and was never imported because it doesn't currently exist.

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.