// 解決IE瀏覽器下導(dǎo)出功能的使用 let blob = new Blob([res], { type: 'application/vnd.ms-excel' }) if (window.navigator && window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveOrOpenBlob(blob, fileName) } else { let link = document.createElement('a') link.href = window.URL.createObjectURL(blob) link.download = fileName link.click() window.URL.revokeObjectURL(link.href) } 由于是之前解決的問(wèn)題忘記搜到的是誰(shuí)的所以忘記原版出處 如有侵權(quán)告知 看到后立馬刪除
|