What is qrcode.vue?
qrcode.vue is a Vue.js component for generating QR codes. It provides a simple and flexible way to create QR codes in your Vue applications.
What are qrcode.vue's main functionalities?
Basic QR Code Generation
This feature allows you to generate a basic QR code by providing a value (e.g., a URL) to the `qrcode-vue` component.
<template>
<qrcode-vue value="https://example.com" />
</template>
<script>
import QrcodeVue from 'qrcode.vue';
export default {
components: {
QrcodeVue
}
};
</script>
Customizing QR Code Size
You can customize the size of the QR code by setting the `size` prop.
<template>
<qrcode-vue value="https://example.com" :size="200" />
</template>
<script>
import QrcodeVue from 'qrcode.vue';
export default {
components: {
QrcodeVue
}
};
</script>
Customizing QR Code Color
This feature allows you to customize the colors of the QR code by setting the `color` prop with `dark` and `light` values.
<template>
<qrcode-vue value="https://example.com" :color="{ dark: '#000000', light: '#ffffff' }" />
</template>
<script>
import QrcodeVue from 'qrcode.vue';
export default {
components: {
QrcodeVue
}
};
</script>
Other packages similar to qrcode.vue
vue-qrcode-reader
vue-qrcode-reader is a Vue.js component for reading QR codes from camera or file input. Unlike qrcode.vue, which focuses on generating QR codes, vue-qrcode-reader is designed for scanning and reading QR codes.
qrcode.react
qrcode.react is a QR code generator for React applications. It provides similar functionality to qrcode.vue but is designed for use with React instead of Vue.
react-qr-code
react-qr-code is another QR code generator for React applications. It offers similar features to qrcode.vue, such as customizable size and color, but is intended for React developers.
qrcode.vue
A Vue.js component for QRCode.
Start quick
the qrcode.vue
component can use in you Vue.js app.
npm install --save qrcode.vue
Usage
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>
Component props
prop | type | default value | expain |
---|
value | String | '' | qrcode value |
className | String | '' | qrcode element className |
size | Number | 100 | qrcode element size |
level | String | L | Error correction level ('L', 'M', 'Q', 'H') |
background | String | #fff | qrcode background color |
foreground | String | #000 | qrcode color |
Thanks
"qr.js" "qrcode.react"
License
MIT