vue-qrious
Advanced tools
Comparing version 1.0.1 to 1.1.0
/*! | ||
* vue-qrious a vue component of generating qrcode with `qrious` | ||
* Version 1.0.1 | ||
* Version 1.1.0 | ||
* Copyright (C) 2017 JounQin <admin@1stg.me> | ||
@@ -15,3 +15,3 @@ * Released under the MIT license | ||
QRious = 'default' in QRious ? QRious['default'] : QRious; | ||
QRious = QRious && 'default' in QRious ? QRious['default'] : QRious; | ||
@@ -48,3 +48,3 @@ var LEVELS = ['L', 'M', 'Q', 'H']; | ||
data: function data() { | ||
var qr = new QRious(this.$options.propsData); | ||
var qr = new QRious(this.$props); | ||
return { | ||
@@ -55,11 +55,11 @@ qr: qr, | ||
}, | ||
created: function created() { | ||
var _this = this; | ||
this.$options._propKeys.forEach(function (key) { | ||
return _this.$watch(key, function () { | ||
_this.qr[key] = _this[key]; | ||
_this.src = _this.qr.toDataURL(_this.mime); | ||
}); | ||
}); | ||
watch: { | ||
$props: { | ||
deep: true, | ||
handler: function handler() { | ||
this.qr.set(this.$props); | ||
this.src = this.qr.toDataURL(this.mime); | ||
} | ||
} | ||
}, | ||
@@ -66,0 +66,0 @@ render: function render() { |
/*! | ||
* vue-qrious a vue component of generating qrcode with `qrious` | ||
* Version 1.0.1 | ||
* Version 1.1.0 | ||
* Copyright (C) 2017 JounQin <admin@1stg.me> | ||
@@ -9,2 +9,2 @@ * Released under the MIT license | ||
*/ | ||
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("qrious")):"function"==typeof define&&define.amd?define("vue-qrious",["qrious"],t):r.VueQrious=t(r.QRious)}(this,function(r){"use strict";r="default"in r?r.default:r;var t=["L","M","Q","H"],e={type:[Number,String],validator:function(r){return!isNaN(+r)}};return{props:{value:{type:String,required:!0},background:String,backgroundAlpha:e,foreground:String,foregroundAlpha:e,level:{type:String,validator:function(r){return t.indexOf(r)+1}},mime:String,padding:e,size:e},data:function(){var t=new r(this.$options.propsData);return{qr:t,src:t.toDataURL(this.mime)}},created:function(){var r=this;this.$options._propKeys.forEach(function(t){return r.$watch(t,function(){r.qr[t]=r[t],r.src=r.qr.toDataURL(r.mime)})})},render:function(){return(0,arguments[0])("img",{attrs:{src:this.src}},[])}}}); | ||
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("qrious")):"function"==typeof define&&define.amd?define("vue-qrious",["qrious"],t):r.VueQrious=t(r.QRious)}(this,function(r){"use strict";r=r&&"default"in r?r.default:r;var t=["L","M","Q","H"],e={type:[Number,String],validator:function(r){return!isNaN(+r)}};return{props:{value:{type:String,required:!0},background:String,backgroundAlpha:e,foreground:String,foregroundAlpha:e,level:{type:String,validator:function(r){return t.indexOf(r)+1}},mime:String,padding:e,size:e},data:function(){var t=new r(this.$props);return{qr:t,src:t.toDataURL(this.mime)}},watch:{$props:{deep:!0,handler:function(){this.qr.set(this.$props),this.src=this.qr.toDataURL(this.mime)}}},render:function(){return(0,arguments[0])("img",{attrs:{src:this.src}},[])}}}); |
/*! | ||
* vue-qrious a vue component of generating qrcode with `qrious` | ||
* Version 1.0.1 | ||
* Version 1.1.0 | ||
* Copyright (C) 2017 JounQin <admin@1stg.me> | ||
@@ -15,3 +15,3 @@ * Released under the MIT license | ||
QRious = 'default' in QRious ? QRious['default'] : QRious; | ||
QRious = QRious && 'default' in QRious ? QRious['default'] : QRious; | ||
@@ -48,3 +48,3 @@ var LEVELS = ['L', 'M', 'Q', 'H']; | ||
data: function data() { | ||
var qr = new QRious(this.$options.propsData); | ||
var qr = new QRious(this.$props); | ||
return { | ||
@@ -55,11 +55,11 @@ qr: qr, | ||
}, | ||
created: function created() { | ||
var _this = this; | ||
this.$options._propKeys.forEach(function (key) { | ||
return _this.$watch(key, function () { | ||
_this.qr[key] = _this[key]; | ||
_this.src = _this.qr.toDataURL(_this.mime); | ||
}); | ||
}); | ||
watch: { | ||
$props: { | ||
deep: true, | ||
handler: function handler() { | ||
this.qr.set(this.$props); | ||
this.src = this.qr.toDataURL(this.mime); | ||
} | ||
} | ||
}, | ||
@@ -66,0 +66,0 @@ render: function render() { |
/*! | ||
* vue-qrious a vue component of generating qrcode with `qrious` | ||
* Version 1.0.1 | ||
* Version 1.1.0 | ||
* Copyright (C) 2017 JounQin <admin@1stg.me> | ||
@@ -9,2 +9,2 @@ * Released under the MIT license | ||
*/ | ||
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("node-qrious")):"function"==typeof define&&define.amd?define("vue-qrious",["node-qrious"],t):r.VueQrious=t(r.QRious)}(this,function(r){"use strict";r="default"in r?r.default:r;var t=["L","M","Q","H"],e={type:[Number,String],validator:function(r){return!isNaN(+r)}};return{props:{value:{type:String,required:!0},background:String,backgroundAlpha:e,foreground:String,foregroundAlpha:e,level:{type:String,validator:function(r){return t.indexOf(r)+1}},mime:String,padding:e,size:e},data:function(){var t=new r(this.$options.propsData);return{qr:t,src:t.toDataURL(this.mime)}},created:function(){var r=this;this.$options._propKeys.forEach(function(t){return r.$watch(t,function(){r.qr[t]=r[t],r.src=r.qr.toDataURL(r.mime)})})},render:function(){return(0,arguments[0])("img",{attrs:{src:this.src}},[])}}}); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("node-qrious")):"function"==typeof define&&define.amd?define("vue-qrious",["node-qrious"],r):e.VueQrious=r(e.QRious)}(this,function(e){"use strict";e=e&&"default"in e?e.default:e;var r=["L","M","Q","H"],t={type:[Number,String],validator:function(e){return!isNaN(+e)}};return{props:{value:{type:String,required:!0},background:String,backgroundAlpha:t,foreground:String,foregroundAlpha:t,level:{type:String,validator:function(e){return r.indexOf(e)+1}},mime:String,padding:t,size:t},data:function(){var r=new e(this.$props);return{qr:r,src:r.toDataURL(this.mime)}},watch:{$props:{deep:!0,handler:function(){this.qr.set(this.$props),this.src=this.qr.toDataURL(this.mime)}}},render:function(){return(0,arguments[0])("img",{attrs:{src:this.src}},[])}}}); |
@@ -29,3 +29,3 @@ import QRious from 'qrious' | ||
data() { | ||
const qr = new QRious(this.$options.propsData) | ||
const qr = new QRious(this.$props) | ||
return { | ||
@@ -36,7 +36,10 @@ qr, | ||
}, | ||
created() { | ||
this.$options._propKeys.forEach(key => this.$watch(key, () => { | ||
this.qr[key] = this[key] | ||
this.src = this.qr.toDataURL(this.mime) | ||
})) | ||
watch: { | ||
$props: { | ||
deep: true, | ||
handler() { | ||
this.qr.set(this.$props) | ||
this.src = this.qr.toDataURL(this.mime) | ||
} | ||
}, | ||
}, | ||
@@ -43,0 +46,0 @@ render() { |
{ | ||
"name": "vue-qrious", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "a vue component of generating qrcode with `qrious`", | ||
@@ -34,5 +34,4 @@ "browser": "dist/vue-qrious.browser", | ||
"cross-env": "^5.0.1", | ||
"rollup": "^0.42.0", | ||
"rollup": "^0.43.0", | ||
"rollup-plugin-babel": "^2.7.1", | ||
"rollup-plugin-replace": "^1.1.1", | ||
"rollup-plugin-uglify": "^2.0.1", | ||
@@ -39,0 +38,0 @@ "rollup-watch": "^4.0.0" |
import babel from 'rollup-plugin-babel' | ||
import replace from 'rollup-plugin-replace' | ||
import uglify from 'rollup-plugin-uglify' | ||
@@ -13,15 +12,3 @@ | ||
const plugins = [babel()] | ||
isServer && plugins.push(replace({ | ||
qrious: 'node-qrious' | ||
})) | ||
isProd && plugins.push(uglify({ | ||
output: { | ||
comments: true | ||
} | ||
})) | ||
export default { | ||
const config = { | ||
banner: `/*! | ||
@@ -37,3 +24,3 @@ * ${pkg.name} ${pkg.description} | ||
dest: `dist/vue-qrious${isServer ? '' : '.browser'}${isProd ? '.min' : ''}.js`, | ||
plugins, | ||
plugins: [babel()], | ||
format: 'umd', | ||
@@ -50,1 +37,13 @@ external: ['qrious', 'node-qrious'], | ||
} | ||
isServer && (config.paths = { | ||
qrious: 'node-qrious' | ||
}) | ||
isProd && config.plugins.push(uglify({ | ||
output: { | ||
comments: true | ||
} | ||
})) | ||
export default config |
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
10
290
89333
3