下载引入html2canvas
<img :src="imgsrc" alt="" crossOrigin="anonymous">
<div class="qr-box" ref='imageWrapper'>
<div style="background: #fff;">
<img :src='require("../../../assets/img/shopShare.jpg")' />
<div id="qrCode" ref="qrCodeUrl">
<img :src="qrurl" alt="" style="width:200px;height:200px">
</div>
<div>扫码成为联营商</div>
<div>超多爆款 轻松赚钱</div>
<div style='width:100%;height:80px'></div>
</div>
</div>
html2canvas(this.$refs.imageWrapper, {
backgroundColor: null,
useCORS: true, // 开启跨域配置
allowTaint: true, // 允许跨域图片
imageTimeout:0,
taintTest: true, // 是否在渲染前测试图片
}).then((canvas) => {
let dataURL = canvas.toDataURL('image/jpeg', 2.0)
this.imgsrc=dataURL
this.loadingInstance.close()
})