js下载文件

let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
})
let link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = '66'
link.click()
window.URL.revokeObjectURL(link.href)
posted @ 2019-07-11 17:51  刘兵博客  阅读(130)  评论(0编辑  收藏  举报