This commit is contained in:
tangly1024
2023-11-18 13:03:00 +08:00
parent 60892530c6
commit 7f8bf757b8
2 changed files with 22 additions and 17 deletions

View File

@@ -14,16 +14,18 @@ export default function QrCode({ value }) {
return
}
loadExternalResource(qrCodeCDN, 'js').then(url => {
const QRCode = window.QRCode
qrcode = new QRCode(document.getElementById('qrcode'), {
text: value,
width: 256,
height: 256,
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H
})
// console.log('二维码', qrcode, value)
const QRCode = window?.QRCode
if (typeof QRCode !== 'undefined') {
qrcode = new QRCode(document.getElementById('qrcode'), {
text: value,
width: 256,
height: 256,
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H
})
// console.log('二维码', qrcode, value)
}
})
return () => {
if (qrcode) {