赞
踩
H5中a链接新增下载属性
export const downloadFile = (blobFile, fileName) => {
let link = document.createElement('a')
link.href = URL.createObjectURL(blobFile)
link.style = 'visibility:hidden'
link.download = fileName
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
link = null
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。