fetchExportBill(url, name) {
axios.get(url, { responseType: "Blob" }).then((res) => {
const blob = new Blob([res], { type: "application/vnd.ms-excel" });
const objectUrl = URL.createObjectURL(blob);
const a = document.createElement("a");
a.setAttribute('download',name)
a.download = name;
a.href = objectUrl;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
});
},
vue2移动端实现文件下载
最新推荐文章于 2024-06-05 22:22:59 发布