首先安装qrcode
<div><canvas id="canvas"></canvas></div>
import QRCode from 'qrcode'
this.$nextTick(() => {
let canvas = document.getElementById('canvas')
QRCode.toCanvas(canvas, src, function (error) {
if (error) console.error(error)
console.log('success!')
})
})