xiazai(){ this.$_api.kanbanApi .Get({ responseType: 'blob', url: 'KanbanItemData/exportExcel' //`${this.selectComponents.config.dataUrl}/exportExcel` }).then(res=>{ console.log(res,'下载模板'); }).catch(err=>{ console.log(err,'err'); //响应封装问题 正常应该在then中 const url = window.URL.createObjectURL(new Blob([err],{type:"application/vnd.ms-excel;charset=utf-8"})); const link = document.createElement('a'); link.href = url; let fileName = '下载'+".xlsx"; link.setAttribute('download', fileName); document.body.appendChild(link); link.click(); }) },
标签:返回,vue,console,log,err,url,res,link,文档 From: https://www.cnblogs.com/qinyuanchun/p/17211583.html