I want to click the button to save a QR code picture in which src is base64 to the phone. I find that it can be saved normally by clicking on the PC, but when I click on the phone, I find that it saves a .bin file
.
is there any solution to this problem, bosses?
the following is the code
qrcodeBut() {
// base64
this.domArr = []
var dom = document.getElementById("qrcodeBut")
this.domArr.push(dom)
console.log(this.domArr)
this.domArr.push(this.domArr[0].children[0].children)
console.log(this.domArr)
var src = this.domArr[1][0].src
console.log(src)
let aLink = document.createElement("a");
let blob = this.base64ToBlob(src); //new Blob([content]);
aLink.download = "fileName";
aLink.href = URL.createObjectURL(blob);
aLink.click()
}