Blob
没有
name
属性
保留原件
type
,并使用
<a>
具有的元素
download
具有的属性
href
设置为
Blob URL
呼叫
.click()
在…上
<a>
将元素附加到后的元素
document.body
.
blobGeneratingFunction.then(blob => {
let a = document.createElement("a")
let blobURL = URL.createObjectURL(blob)
a.download = 'test.png'
a.href = blobURL
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
})