1.0.4 • Published 3 years ago

vue-digital-flop v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

vue-digital-flop

It's a vue component that will count to a target number at a specified duration.

vue2 Gemnasium license npm

vue-digital-flop is a dependency-free, lightweight vue component that can be overwrited easingFn by yourself. You can set startVal and endVal ,it will automatic judge count up or count down.If you set isFrequent and frequentTime, it will automatic judge count up or count down frequently. It is support vue-ssr. It is learn from countUp.js;

Try the demo

How to use?

npm install vue-digital-flop

Example

<template>
	<vue-digital-flop :startVal="startVal" :endVal="endVal" :duration="3000" />
</template>

<script>
import vueDigitalFlop from "vue-digital-flop";
export default {
	components: { vueDigitalFlop },
	data() {
		return {
			startVal: 0,
			endVal: 2021,
		};
	},
};
</script>

demo:

demo

Use CDN Script: demo

Options

PropertyDescriptiontypedefault
startValthe value you want to begin atNumber0
endValthe value you want to arrive atNumber2021
isFrequentthe value you want to play frequenlyBooleanfalse
frequentTimethe value is automatic frequent change timeNumber5000
durationduration in millisecondNumber3000
autoplaywhen mounted autoplayBooleantrue
decimalsthe number of decimal places to showNumber0
decimalthe split decimalString.
separatorthe separatorString,
prefixthe prefixString''
suffixthe suffixString''
useEasingis use easing functionBooleantrue
easingFnthe easing functionFunction

notes: when autoplay:true , it will auto start when startVal or endVal change

notes: when isFrequent:true, but you don't set frequentTime, it will auto frequently play every 5000 milliseconds.

Functions

Function NameDescription
mountedCallbackwhen mounted will emit mountedCallback
startstart the countTo
pausepause the countTo
resetreset the countTo
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago