已解决
前端用 js-file-download组件下载后端返回的pdf,word,excel文件
来自网友在路上 174874提问 提问时间:2023-10-21 12:54:22阅读次数: 74
最佳答案 问答题库748位专家为你答疑解惑
后端返回的pdf,word,excel的文件流导出需要让浏览器下载文件
1、安装js-file-download组件
npm install js-file-download --save
2、在对应的页面引用
import fileDownload from "js-file-download";
3、在接口返回结果后直接调用即可
let data={id:processId,customerId:customerId
}
//后台导出文件接口
feeNotification(data).then(res => {//调用fileDownload即可fileDownload(res, 'xxxx.xlsx');
})
查看全文
99%的人还看了
相似问题
猜你感兴趣
版权申明
本文"前端用 js-file-download组件下载后端返回的pdf,word,excel文件":http://eshow365.cn/6-20823-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!