vue文件导出文件
//准备 npm install js-file-download --save //使用 export function download(val) { return flies({ url: "/assets/exportAssets", method: "get", params: val, responseType: "blob", }); } //页面使用 import { download } from './index.js' import fileDownload from "js-file-download"; let obj = //你的参数 ,可不传; download(obj).then((res) => { fileDownload(res.data, "资产数据.xlsx"); }); //如果有问题,检查自己的拦截器这块是否存在问题
本文来自博客园,作者:小万子呀,转载请注明原文链接:https://www.cnblogs.com/newBugs/p/16300265.html