Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-countup-v2

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-countup-v2 - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

dist/js/app.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("icountup",[],e):"object"==typeof exports?exports.icountup=e():t.icountup=e()}(this,function(){return function(t){function e(a){if(n[a])return n[a].exports;var i=n[a]={exports:{},id:a,loaded:!1};return t[a].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="/",e(0)}([function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(4),r=a(i);e.default=r.default},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),r=a(i);e.default={name:"ICountUp",props:{start:{type:Number,required:!1,default:0},end:{type:Number,required:!0},decimals:{type:Number,required:!1,default:0},duration:{type:Number,required:!1,default:2},options:{type:Object,required:!1},callback:{type:Function,required:!1,default:function(){}}},data:function(){return{instance:null}},computed:{getStart:function(){return this.start},getEnd:function(){return this.end},getDecimals:function(){return this.decimals},getDuration:function(){return this.duration}},watch:{},methods:{init:function(){var t=this;if(!t.instance){var e=t.$el;t.instance=new r.default(e,t.getStart,t.getEnd,t.getDecimals,t.getDuration,t.options),t.instance.start(function(){t.callback(t.instance)})}},destroy:function(){var t=this;t.instance=null}},beforeCreate:function(){},created:function(){},beforeMount:function(){},mounted:function(){var t=this;t.init()},beforeUpdate:function(){},updated:function(){},activated:function(){},deactivated:function(){},beforeDestroy:function(){var t=this;t.destroy()},destroyed:function(){},start:function(t){var e=this;e.instance&&e.instance.start&&e.instance.start(function(){t&&t(e.instance)})},pauseResume:function(){var t=this;t.instance&&t.instance.pauseResume&&t.instance.pauseResume()},reset:function(){var t=this;t.instance&&t.instance.reset&&t.instance.reset()},update:function(t){var e=this;e.instance&&e.instance.update&&e.instance.update(t)}}},function(t,e,n){var a,i;!function(r,o){a=o,i="function"==typeof a?a.call(e,n,e,t):a,!(void 0!==i&&(t.exports=i))}(this,function(t,e,n){var a=function(t,e,n,a,i,r){for(var o=0,u=["webkit","moz","ms","o"],s=0;s<u.length&&!window.requestAnimationFrame;++s)window.requestAnimationFrame=window[u[s]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[u[s]+"CancelAnimationFrame"]||window[u[s]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,e){var n=(new Date).getTime(),a=Math.max(0,16-(n-o)),i=window.setTimeout(function(){t(n+a)},a);return o=n+a,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)});var c=this;c.options={useEasing:!0,useGrouping:!0,separator:",",decimal:".",easingFn:null,formattingFn:null};for(var d in r)r.hasOwnProperty(d)&&(c.options[d]=r[d]);""===c.options.separator&&(c.options.useGrouping=!1),c.options.prefix||(c.options.prefix=""),c.options.suffix||(c.options.suffix=""),c.d="string"==typeof t?document.getElementById(t):t,c.startVal=Number(e),c.endVal=Number(n),c.countDown=c.startVal>c.endVal,c.frameVal=c.startVal,c.decimals=Math.max(0,a||0),c.dec=Math.pow(10,c.decimals),c.duration=1e3*Number(i)||2e3,c.formatNumber=function(t){t=t.toFixed(c.decimals),t+="";var e,n,a,i;if(e=t.split("."),n=e[0],a=e.length>1?c.options.decimal+e[1]:"",i=/(\d+)(\d{3})/,c.options.useGrouping)for(;i.test(n);)n=n.replace(i,"$1"+c.options.separator+"$2");return c.options.prefix+n+a+c.options.suffix},c.easeOutExpo=function(t,e,n,a){return n*(-Math.pow(2,-10*t/a)+1)*1024/1023+e},c.easingFn=c.options.easingFn?c.options.easingFn:c.easeOutExpo,c.formattingFn=c.options.formattingFn?c.options.formattingFn:c.formatNumber,c.version=function(){return"1.7.1"},c.printValue=function(t){var e=c.formattingFn(t);"INPUT"===c.d.tagName?this.d.value=e:"text"===c.d.tagName||"tspan"===c.d.tagName?this.d.textContent=e:this.d.innerHTML=e},c.count=function(t){c.startTime||(c.startTime=t),c.timestamp=t;var e=t-c.startTime;c.remaining=c.duration-e,c.options.useEasing?c.countDown?c.frameVal=c.startVal-c.easingFn(e,0,c.startVal-c.endVal,c.duration):c.frameVal=c.easingFn(e,c.startVal,c.endVal-c.startVal,c.duration):c.countDown?c.frameVal=c.startVal-(c.startVal-c.endVal)*(e/c.duration):c.frameVal=c.startVal+(c.endVal-c.startVal)*(e/c.duration),c.countDown?c.frameVal=c.frameVal<c.endVal?c.endVal:c.frameVal:c.frameVal=c.frameVal>c.endVal?c.endVal:c.frameVal,c.frameVal=Math.round(c.frameVal*c.dec)/c.dec,c.printValue(c.frameVal),e<c.duration?c.rAF=requestAnimationFrame(c.count):c.callback&&c.callback()},c.start=function(t){return c.callback=t,c.rAF=requestAnimationFrame(c.count),!1},c.pauseResume=function(){c.paused?(c.paused=!1,delete c.startTime,c.duration=c.remaining,c.startVal=c.frameVal,requestAnimationFrame(c.count)):(c.paused=!0,cancelAnimationFrame(c.rAF))},c.reset=function(){c.paused=!1,delete c.startTime,c.startVal=e,cancelAnimationFrame(c.rAF),c.printValue(c.startVal)},c.update=function(t){cancelAnimationFrame(c.rAF),c.paused=!1,delete c.startTime,c.startVal=c.frameVal,c.endVal=Number(t),c.countDown=c.startVal>c.endVal,c.rAF=requestAnimationFrame(c.count)},c.printValue(c.startVal)};return a})},function(t,e){},function(t,e,n){var a,i;n(3),a=n(1);var r=n(5);i=a=a||{},"object"!=typeof a.default&&"function"!=typeof a.default||(i=a=a.default),"function"==typeof i&&(i=i.options),i.render=r.render,i.staticRenderFns=r.staticRenderFns,i._scopeId="data-v-679a8781",t.exports=a},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span")},staticRenderFns:[]}}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("icountup",[],e):"object"==typeof exports?exports.icountup=e():t.icountup=e()}(this,function(){return function(t){function e(a){if(n[a])return n[a].exports;var i=n[a]={exports:{},id:a,loaded:!1};return t[a].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="/",e(0)}([function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(4),r=a(i);e.default=r.default},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),r=a(i);e.default={name:"ICountUp",props:{start:{type:Number,required:!1,default:0},end:{type:Number,required:!0},decimals:{type:Number,required:!1,default:0},duration:{type:Number,required:!1,default:2},options:{type:Object,required:!1},callback:{type:Function,required:!1,default:function(){}}},data:function(){return{instance:null}},computed:{},watch:{end:{handler:function(t){var e=this;e.instance&&e.instance.update&&e.instance.update(t)},deep:!1}},methods:{init:function(){var t=this;if(!t.instance){var e=t.$el;t.instance=new r.default(e,t.start,t.end,t.decimals,t.duration,t.options),t.instance.start(function(){t.callback(t.instance)})}},destroy:function(){var t=this;t.instance=null}},beforeCreate:function(){},created:function(){},beforeMount:function(){},mounted:function(){var t=this;t.init()},beforeUpdate:function(){},updated:function(){},activated:function(){},deactivated:function(){},beforeDestroy:function(){var t=this;t.destroy()},destroyed:function(){},start:function(t){var e=this;e.instance&&e.instance.start&&e.instance.start(function(){t&&t(e.instance)})},pauseResume:function(){var t=this;t.instance&&t.instance.pauseResume&&t.instance.pauseResume()},reset:function(){var t=this;t.instance&&t.instance.reset&&t.instance.reset()},update:function(t){var e=this;e.instance&&e.instance.update&&e.instance.update(t)}}},function(t,e,n){var a,i;!function(r,o){a=o,i="function"==typeof a?a.call(e,n,e,t):a,!(void 0!==i&&(t.exports=i))}(this,function(t,e,n){var a=function(t,e,n,a,i,r){for(var o=0,u=["webkit","moz","ms","o"],s=0;s<u.length&&!window.requestAnimationFrame;++s)window.requestAnimationFrame=window[u[s]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[u[s]+"CancelAnimationFrame"]||window[u[s]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,e){var n=(new Date).getTime(),a=Math.max(0,16-(n-o)),i=window.setTimeout(function(){t(n+a)},a);return o=n+a,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)});var c=this;c.options={useEasing:!0,useGrouping:!0,separator:",",decimal:".",easingFn:null,formattingFn:null};for(var d in r)r.hasOwnProperty(d)&&(c.options[d]=r[d]);""===c.options.separator&&(c.options.useGrouping=!1),c.options.prefix||(c.options.prefix=""),c.options.suffix||(c.options.suffix=""),c.d="string"==typeof t?document.getElementById(t):t,c.startVal=Number(e),c.endVal=Number(n),c.countDown=c.startVal>c.endVal,c.frameVal=c.startVal,c.decimals=Math.max(0,a||0),c.dec=Math.pow(10,c.decimals),c.duration=1e3*Number(i)||2e3,c.formatNumber=function(t){t=t.toFixed(c.decimals),t+="";var e,n,a,i;if(e=t.split("."),n=e[0],a=e.length>1?c.options.decimal+e[1]:"",i=/(\d+)(\d{3})/,c.options.useGrouping)for(;i.test(n);)n=n.replace(i,"$1"+c.options.separator+"$2");return c.options.prefix+n+a+c.options.suffix},c.easeOutExpo=function(t,e,n,a){return n*(-Math.pow(2,-10*t/a)+1)*1024/1023+e},c.easingFn=c.options.easingFn?c.options.easingFn:c.easeOutExpo,c.formattingFn=c.options.formattingFn?c.options.formattingFn:c.formatNumber,c.version=function(){return"1.7.1"},c.printValue=function(t){var e=c.formattingFn(t);"INPUT"===c.d.tagName?this.d.value=e:"text"===c.d.tagName||"tspan"===c.d.tagName?this.d.textContent=e:this.d.innerHTML=e},c.count=function(t){c.startTime||(c.startTime=t),c.timestamp=t;var e=t-c.startTime;c.remaining=c.duration-e,c.options.useEasing?c.countDown?c.frameVal=c.startVal-c.easingFn(e,0,c.startVal-c.endVal,c.duration):c.frameVal=c.easingFn(e,c.startVal,c.endVal-c.startVal,c.duration):c.countDown?c.frameVal=c.startVal-(c.startVal-c.endVal)*(e/c.duration):c.frameVal=c.startVal+(c.endVal-c.startVal)*(e/c.duration),c.countDown?c.frameVal=c.frameVal<c.endVal?c.endVal:c.frameVal:c.frameVal=c.frameVal>c.endVal?c.endVal:c.frameVal,c.frameVal=Math.round(c.frameVal*c.dec)/c.dec,c.printValue(c.frameVal),e<c.duration?c.rAF=requestAnimationFrame(c.count):c.callback&&c.callback()},c.start=function(t){return c.callback=t,c.rAF=requestAnimationFrame(c.count),!1},c.pauseResume=function(){c.paused?(c.paused=!1,delete c.startTime,c.duration=c.remaining,c.startVal=c.frameVal,requestAnimationFrame(c.count)):(c.paused=!0,cancelAnimationFrame(c.rAF))},c.reset=function(){c.paused=!1,delete c.startTime,c.startVal=e,cancelAnimationFrame(c.rAF),c.printValue(c.startVal)},c.update=function(t){cancelAnimationFrame(c.rAF),c.paused=!1,delete c.startTime,c.startVal=c.frameVal,c.endVal=Number(t),c.countDown=c.startVal>c.endVal,c.rAF=requestAnimationFrame(c.count)},c.printValue(c.startVal)};return a})},function(t,e){},function(t,e,n){var a,i;n(3),a=n(1);var r=n(5);i=a=a||{},"object"!=typeof a.default&&"function"!=typeof a.default||(i=a=a.default),"function"==typeof i&&(i=i.options),i.render=r.render,i.staticRenderFns=r.staticRenderFns,i._scopeId="data-v-679a8781",t.exports=a},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span")},staticRenderFns:[]}}])});
//# sourceMappingURL=app.js.map
{
"name": "vue-countup-v2",
"title": "vue-countup-v2",
"version": "0.1.1",
"version": "0.1.2",
"description": "Vue.js(v2.x+) component wrap for countUp.js(v1.x+)",

@@ -6,0 +6,0 @@ "author": "xLsDg <xlsdg@qq.com> (https://blog.xlsdg.org/)",

@@ -12,2 +12,3 @@ import Vue from 'vue';

return {
num: 0,
options: {

@@ -25,5 +26,11 @@ useEasing: true,

callback: function(ins) {
ins.update(ins.endVal + 100);
// ins.update(ins.endVal + 100);
}
},
mounted() {
const that = this;
setInterval(function() {
that.num = that.num + 100;
}, 3000);
}
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc