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() window.URL.revokeObjectURL(url) // 释放url },
标签:url,标签,fileName,link,download,JS,下载 From: https://www.cnblogs.com/shining-feifan/p/16866062.html