前端下载文件以及成功后执行回调的方法
前端完成下载
//a标签或者window.location.href = ""实现下载 downloadTable(info) { window.location.href =url } downloadAnnex(annex) { window.open(annex.url); // window.location.href=annex.url },
下载完成时,执行操作
// 监听下载完成回调 let net = window.open(url); net.addEventListener("beforeunload", e => { console.log(11111, e); });