JS a标签文件下载
aDownload(url, fileName) { const link = document.createElement('a') link.style.display = 'none' link.href = url link.download = fileName // link.setAttribute('download', fileName) document.body.appendChild(link) link.click() // a标签自动触发点击事件 link.remove()
document.body.removeChild(link)
window.URL.revokeObjectURL(url) // 释放url },