A Vue.js component to generate QRCode.
the qrcode.vue
component can use in you Vue.js app.
npm install --save qrcode.vue # yarn add qrcode.vue
e.g.
import Vue from 'vue'
import QrcodeVue from 'qrcode.vue'
new Vue({
el: '#root',
data: {
value: 'https://example.com',
},
template: '<qrcode-vue :value="value"></qrcode-vue>',
components: {
QrcodeVue,
},
})
Or single-file components with a *.vue
extension:
<template>
<div>
<qrcode-vue :value="value" :size="size" level="H"></qrcode-vue>
</div>
</template>
<script>
import QrcodeVue from 'qrcode.vue'
export default {
data() {
return {
value: 'https://example.com',
size: 300,
}
},
components: {
QrcodeVue,
},
}
</script>
- Type:
string
- Default:
''
The value content of qrcode
- Type:
string
- Default:
L
qrcode Error correction level (one of 'L', 'M', 'Q', 'H'). Know more, wikipedia: QR_code
- Type:
number
- Default:
100
The size of qrcode element.
- Type:
string
- Default:
canvas
Generate QRcode as canvas
or svg
.
- Type:
string
- Default:
#ffffff
The background color of qrcode.
- Type:
string
- Default:
#000000
The foreground color of qrcode.
- Type:
string
- Default:
''
The class name of qrcode element.
copyright © 2017 @scopewu, license by MIT