// 解决导出图片模糊的方法
toBeCanvas() {
var copyDom = $("#canvasQR");
var width = copyDom.offsetWidth; //dom宽
var height = copyDom.offsetHeight; //dom高
var scale = 2; //放大倍数
html2canvas(this.$refs['order'], {
dpi: window.devicePixelRatio * 2,
scale: scale,
width: width,
heigth: height,
}).then(canvas => {
const context = canvas.getContext('2d');
// 【重要】关闭抗锯齿
context.mozImageSmoothingEnabled = false;
context.webkitImageSmoothingEnabled = false;
context.msImageSmoothingEnabled = false;
context.imageSmoothingEnabled = false;
var url = canvas.toDataURL();
var triggerDownload = $("<a>").attr("href", url).attr("download", "详情.png").appendTo("body");
triggerDownload[0].click();
triggerDownload.remove();
});
},