欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

axios导出 exer

程序员文章站 2022-03-12 20:51:44
this.axios({ url: `${this.domain}ledger/people/exportExcel`, responseType: 'blob', method: 'post', data: params}).then(res => { if(res.data) { let blo ......
this.axios({
url: `${this.domain}ledger/people/exportExcel`,
responseType: 'blob',
method: 'post',
data: params
}).then(res => {
if(res.data) {
let blob = res.data
let a = document.createElement('a')
let url = window.URL.createObjectURL(blob)
let filename = '重点人.xls'
a.href = url
a.download = filename
a.click()
window.URL.revokeObjectURL(url)
}
})