vue 生成二维码插件 vue-qrcode

连接地址生成二维码

安装

https://www.npmjs.com/package...vue

npm install --save qrcode.vue

在组件中引入

<template>
    <qrcode-vue :value="'http://wwww.baidu.com'"></qrcode-vue>
</tempalte>
import QrcodeVue from 'qrcode.vue'
...
components:{
    QrcodeVue,
},

属性详解

| 属性名称    | 说明 |
| version    | 数字(1-40) |
| errorCorrectionLevel | `字符串`('low', 'medium', 'quartile', 'high', 'L', 'M', 'Q', 'H') |
| maskPattern| `number`(0-7) |
| toSJISFunc | function      |
| marign     | number        |
| scale      | number        |
| width      | number        |
| color      | {dark: string; ligth: string |
| type       | string('image/png', 'image/jpeg', 'image/webp' |
| quality    | number(0-1)   |
| value      | string | Array<{ data: string; mode?: string }>