链接生成二维码 1.npm安装 npm install --save qrcodejs2 2.引入 import QRCode from 'qrcodejs2' 3.生成二维码 new QRCode('qrcode', { // 传入容器id text: url, // 链接(必填) width: 200, // 宽px height: 200, // 高px colorLight: '#F1F1F1' // 背景色 colorDark: '#F00', // 前景色 correctLevel: QRCode.CorrectLevel.L // 二维码可辨识度(L,M,Q,H) }) 4.代码演示: <style lang="less" scoped> #qrcode { width : 1.81rem ; height : 1.81rem ; padding : .15rem ; background : #F1F1F1 ; /deep/img{ width : 100% ; height : 100% ; } } </style> CSS < div id ="qrcode" ></ div > HTML // eslint-disable-next-line // 屏蔽下一行eslint报错 new QRCode('qrcode', { // 容器id text: