下载二进制文件
作者:
Thomas赵骐 | 来源:发表于
2019-09-29 12:02 被阅读0次 this.$http
.post(URL, qs.stringify(data), {
responseType: 'blob'
})
.then(res => {
let blob = new Blob([res.data], {
type:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
})
let downloadElement = document.createElement('a')
let href = window.URL.createObjectURL(blob)
downloadElement.href = href
downloadElement.download = scope.row.project_number
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement)
window.URL.revokeObjectURL(href)
})
本文标题:下载二进制文件
本文链接:https://www.haomeiwen.com/subject/dnrfpctx.html
网友评论