xlsdg / vue-countup-v2

Vue.js component wrap for countUp.js
https://inorganik.github.io/countUp.js/
MIT License
379 stars 56 forks source link

Methods incorrectly configured #1

Closed daniel-shuy closed 6 years ago

daniel-shuy commented 7 years ago

I believe you've made a slight mistake in not putting the Vue methods in the methods block.

xlsdg commented 6 years ago

like this:

import ICountUp from 'vue-countup-v2';
ICountUp.reset();
daniel-shuy commented 6 years ago

If a Vue Component instantiates multiple CountUp instances in its template, how would one reset only a specific CountUp?

xlsdg commented 6 years ago

Use ready event to get different instances.

daniel-shuy commented 6 years ago

I see... it still feels cumbersome to have to create a data field to store each instance.

May I suggest adding the methods to methods so that they can be called using $refs (similar to #2, but without removing the static methods)? Eg. this.$refs.userCount.reset()

xlsdg commented 6 years ago

You are right, I've already upgraded version to v1.0.3.