export const downloadReservation = params => request.post(`/接口名称`, params, { responseType: 'blob' })
// 第一个参数为后端返回的数据
// 第二个参数为文件名称
export const downloadFile = (data,name) => {
const url = window.URL.createObjectURL(data)
let a = document.createElement('a')
a.style.display = 'none'
a.href = url
a.setAttribute('download', `${name}.xlsx`)
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
前端导出excel封装
最新推荐文章于 2025-11-24 02:17:16 发布
此博客围绕前端开发展开,重点提及JavaScript这一开发语言,虽未给出具体内容,但可知与前端技术和JavaScript运用相关。
2064

被折叠的 条评论
为什么被折叠?



