//下载
async handlerDetail(row) {
let params = {
ids: row.id,
};
let res = await this.$Api.word.Download(params);
const blob = new Blob([res]);
const fileName = row.name + row.type;
const elink = document.createElement("a"); // 创建a标签
elink.download = fileName; // 为a标签添加download属性 // a.download = fileName; //命名下载名称
elink.style.display = "none";
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click(); // 点击下载
URL.revokeObjectURL(elink.href); // 释放URL 对象
document.body.removeChild(elink); // 释放标签
},
vue导出不同类型的文件
最新推荐文章于 2023-08-28 14:55:42 发布