const saveFile = (data: BlobPart) => {
var name = new Date().valueOf() + ".zip";
var a = document.createElement("a");
var url = window.URL.createObjectURL(new Blob([data], { type: "application/zip" }));
var body = document.getElementsByTagName("body")[0];
a.href = url;
a.download = name;
body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
a.remove();
};
根据URL模拟点击下载事件
最新推荐文章于 2023-10-16 10:32:18 发布