file-saver 下载文件包使用

npm install file-saver --save
this.$http.downFileApi(this.downForm).then((res) => { this.spinning = false; const blob = new Blob([res.data], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", }); saveAs(blob, decodeURI(res.headers["download-filename"])); this.downForm.timedata = null; });

 

posted @ 2022-12-01 14:14  Webwhl  阅读(386)  评论(0编辑  收藏  举报