不同设备上导出图片不一样,有些设备导出图片不全
//这个方法导致导出图片不全
let scale = window.devicePixelRatio
let context = canvas2.getContext("2d");
context.scale( 2,2);
//设置scale = 2 在option里面直接写2也可以,导出图片就正常了
let scale =2;
html2canvas(this.$refs.poster, {
canvas:canvas2,
width:width,
height:height,
scale:scale,
backgroundColor: "rgba(0, 0, 0, 0)", // 背景颜色
useCORS: true // 如果截图的内容里有图片,可能会有跨域的情况,加上这个参数,解决文件跨域问题
})