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.2 to 1.0.1

dist/vue-countup.js

80

package.json
{
"name": "vue-countup-v2",
"title": "vue-countup-v2",
"version": "0.1.2",
"description": "Vue.js(v2.x+) component wrap for countUp.js(v1.x+)",
"author": "xLsDg <xlsdg@qq.com> (https://blog.xlsdg.org/)",
"homepage": "https://github.com/xlsdg/vue-countup-v2",
"private": false,
"main": "dist/js/app.js",
"license": "MIT",
"files": [
"dist/js",
"src"
],
"version": "1.0.1",
"description": "Vue.js(v2.x+) component wrap for CountUp.js(v1.x+)",
"keywords": [
"vue",
"vue2",
"countup",
"countup.js",
"library",
"vue",
"vue-countup",
"vue-countup-v2",
"library"
"vue-countup-v2"
],
"scripts": {
"build": "webpack -p --config build/webpack.prod.conf.js",
"dev": "webpack-dev-server --inline --hot --config build/webpack.dev.conf.js"
"homepage": "https://github.com/xlsdg/vue-countup-v2",
"bugs": {
"url": "https://github.com/xlsdg/vue-countup-v2/issues"
},
"license": "MIT",
"author": "xLsDg <xlsdg@qq.com> (https://blog.xlsdg.org/)",
"files": [
"dist",
"src"
],
"main": "dist/vue-countup.js",
"repository": {

@@ -32,39 +28,21 @@ "type": "git",

},
"bugs": {
"url": "https://github.com/xlsdg/vue-countup-v2/issues"
"scripts": {
"build": "webpack --progress --hide-modules"
},
"dependencies": {
"countup.js": "^1.8.1",
"vue": "^2.1.8"
"lodash": "latest"
},
"devDependencies": {
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.10",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-stage-2": "^6.18.0",
"babel-register": "^6.18.0",
"babel-runtime": "^6.20.0",
"css-loader": "^0.26.1",
"eslint": "^3.12.2",
"eslint-config-standard": "^6.2.1",
"eslint-friendly-formatter": "^2.0.6",
"eslint-loader": "^1.6.1",
"eslint-plugin-html": "^1.7.0",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^2.0.1",
"extract-text-webpack-plugin": "^1.0.1",
"function-bind": "^1.1.0",
"html-webpack-plugin": "^2.24.1",
"vue-loader": "^10.0.2",
"vue-style-loader": "^1.0.0",
"vue-template-compiler": "^2.1.8",
"webpack": "^1.14.0",
"webpack-dev-server": "^1.16.2",
"webpack-merge": "^2.0.0"
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-lodash": "^3.3.2",
"babel-preset-env": "^1.6.1",
"lodash-webpack-plugin": "^0.11.4",
"webpack": "^3.10.0"
},
"engines": {
"node": ">= 6.0.0"
}
"peerDependencies": {
"countup.js": "*",
"vue": "*"
},
"title": "vue-countup-v2"
}
# vue-countup-v2
> Vue.js(v2.x+) component wrap for countUp.js(v1.x+)
> Vue.js(v2.x+) component wrap for CountUp.js(v1.x+)

@@ -9,3 +9,3 @@

``` bash
$ npm install --save vue-countup-v2
$ npm install --save countup.js vue-countup-v2
```

@@ -19,10 +19,10 @@

<div class="iCountUp">
<i-count-up
:start="0"
:end="120500"
:decimals="0"
:duration="2.5"
<ICountUp
:startVal="startVal"
:endVal="endVal"
:decimals="decimals"
:duration="duration"
:options="options"
:callback="callback"
></i-count-up>
@ready="onReady"
/>
</div>

@@ -34,3 +34,3 @@ </template>

export default {
name: 'view',
name: 'demo',
components: {

@@ -41,2 +41,6 @@ ICountUp

return {
startVal: 0,
endVal: 120500,
decimals: 0,
duration: 2.5,
options: {

@@ -53,4 +57,5 @@ useEasing: true,

methods: {
callback: function(ins) {
ins.update(ins.endVal + 100);
onReady: function(instance, ECharts) {
const that = this;
instance.update(that.endVal + 100);
}

@@ -72,7 +77,7 @@ }

* `start` **[Number]**
* `startVal` **[Number]**
Optional; `0` by defualt. The value you want to begin at.
* `end` **[Number]**
* `endVal` **[Number]**

@@ -93,6 +98,2 @@ Required; The value you want to arrive at.

* `callback` **[Function]**
Optional; Some method to call on complete.
See more [countUp.js](https://github.com/inorganik/countUp.js)

@@ -111,13 +112,4 @@

## Development
``` bash
$ git clone https://github.com/xlsdg/vue-countup-v2.git vue-countup
$ cd vue-countup && npm i && npm run dev
```
Then open `http://localhost:8080/` to see the demo.
# License
MIT

@@ -1,3 +0,155 @@

import ICountUp from './iCountUp.vue';
import _ from 'lodash';
import CountUp from 'countup.js';
const ICountUp = {
__countup__: CountUp,
name: 'ICountUp',
props: {
startVal: {
type: Number,
required: false,
default: 0
},
endVal: {
type: Number,
required: true
},
decimals: {
type: Number,
required: false,
default: 0
},
duration: {
type: Number,
required: false,
default: 2
},
options: {
type: Object,
required: false
}
},
data() {
return {
instance: null
};
},
// computed: {},
watch: {
endVal: {
handler: function(value) {
const that = this;
if (that.instance && _.isFunction(that.instance.update)) {
that.instance.update(value);
}
},
deep: false
}
},
methods: {
init() {
const that = this;
if (that.instance) {
return;
}
const dom = that.$el;
const instance = new CountUp(
dom,
that.startVal,
that.endVal,
that.decimals,
that.duration,
that.options
);
if (instance.error) {
// error
} else {
instance.start(() => that.$emit('ready', instance, CountUp));
that.instance = instance;
}
},
uninit() {
const that = this;
that.instance = null;
}
},
// beforeCreate() {
// const that = this;
// console.log('beforeCreate');
// },
// created() {
// const that = this;
// console.log('created');
// },
// beforeMount() {
// const that = this;
// console.log('beforeMount');
// },
mounted() {
const that = this;
// console.log('mounted');
that.init();
},
// beforeUpdate() {
// const that = this;
// console.log('beforeUpdate');
// },
// updated() {
// const that = this;
// console.log('updated');
// },
// activated() {
// const that = this;
// console.log('activated');
// },
// deactivated() {
// const that = this;
// console.log('deactivated');
// },
beforeDestroy() {
const that = this;
// console.log('beforeDestroy');
that.uninit();
},
// destroyed() {
// const that = this;
// console.log('destroyed');
// },
start(callback) {
const that = this;
if (that.instance && _.isFunction(that.instance.start) && _.isFunction(callback)) {
return that.instance.start(callback);
}
},
pauseResume() {
const that = this;
if (that.instance && _.isFunction(that.instance.pauseResume)) {
return that.instance.pauseResume();
}
},
reset() {
const that = this;
if (that.instance && _.isFunction(that.instance.reset)) {
return that.instance.reset();
}
},
update(newEndVal) {
const that = this;
if (that.instance && _.isFunction(that.instance.update)) {
return that.instance.update(newEndVal);
}
},
render(h) {
// const that = this;
return h('span', {});
}
};
export default ICountUp;

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