//imageBase64是后台传回来的base64数据
handleDownloadQrIMg(imageBase64) {
// 这里是获取到的图片base64编码,这里只是个例子哈,要自行编码图片替换这里才能测试看到效果
const imgUrl = `data:image/jpg;base64,${imageBase64}`;
// 如果浏览器支持msSaveOrOpenBlob方法(也就是使用IE浏览器的时候),那么调用该方法去下载图片
if () {
const bstr = atob((',')[1]);
let n = ;
const u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = (n);
}
const blob = new Blob([u8arr]);
(blob, '');
} else {
// 这里就按照chrome等新版浏览器来处理
const a = ('a');
= imgUrl;
('download', '');
();
}
}