html2canvas图片跨域问题

时间:2019-08-29 10:02:27   收藏:0   阅读:973

img添加属性

crossorigin="anonymous"
<img :src="bgurl" class="width100b" crossorigin="anonymous"/>
html2canvas(document.getElementById("lbcc"), {
useCORS: true
}).then(canvas => {
const dataURL = canvas.toDataURL("image/png");
this.dataURL = dataURL;
});

原文:https://www.cnblogs.com/liubingboke/p/11427950.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!