
vue
jianghaha2011
这个作者很懒,什么都没留下…
展开
-
vue导出word模版文档
下载依赖及相关版本号 npm install XXX@版本号 "pizzip": "^3.0.6", "docxtemplater": "^3.22.1", "file-saver": "^2.0.2", "jszip-utils": "^0.1.0", 引用 import Docxtemplater from 'docxtemplater'; import { saveAs } from 'file-saver'; // import JSZip from 'jszip'; import PizZip原创 2021-12-17 14:24:32 · 986 阅读 · 1 评论 -
前端文件 下载导出 -- 2
方法一 请求体头部设置:responseType: 'arraybuffer' // 导出报告 handleExport(item) { this.$api.bizApi.qualityAssessment.downloadPdf({reportId: item.reportId}).then((res) => { this.download(item.reportName + '.pdf', res) }) },原创 2021-10-08 09:46:35 · 159 阅读 · 0 评论 -
前端文件 下载 -- 使用二进制流
话不多说,直接贴代码 export function downloadAction(url, method, parameter, filename) { return request({ url: url, method: method, params: parameter, responseType: 'blob', }).then(response => { const type = response原创 2021-04-16 14:00:00 · 224 阅读 · 0 评论