Closed qinhui6 closed 6 years ago
你传的 undefined 了
怎么获取callback值呢?生成的二维码的下载地址
<vue-qr :text="text" :autoColor='true' :logoSrc="src2" :size="400" :margin="0" :callback="fun"></vue-qr>
methods:{
fun(url){
console.log(url)
}
}
callback 拿到的是 base64
if (this._bindElement !== undefined) { try { var el = document.getElementById(this._bindElement); if (el.nodeName === 'IMG') { el.src = this._elCanvas.toDataURL(); } else { var elStyle = el.style; elStyle["background-image"] = 'url(' + this._elCanvas.toDataURL() + ')'; elStyle["background-size"] = 'contain'; elStyle["background-repeat"] = 'no-repeat'; } } catch (e) { console.error(e); } } 这里报错TypeError: Cannot read property 'nodeName' of null 不知道哪里出了问题
@liuchang0108 晚点修复
用 :text传入变量url报错了,麻烦帮忙看一下