0
点赞
收藏
分享

微信扫一扫

a标签下载图片,不要预览


const downloadhandler = () => {
const link = document.createElement('a')
// 这里是将url转成blob地址 将链接地址字符内容转变成blob地址
fetch(icoUrl).then(res => res.blob()).then(blob => {
link.href = URL.createObjectURL(blob)
link.download = icoData.data.download_file_path
document.body.appendChild(link)
link.click()
})
}


举报

相关推荐

0 条评论