打包下载怎么实现?

down_zbUploadClearfile({ //http接口

name:'1'

time:'7',

}).then(async (res) => {

if (res) {

this.selectData = \[\];

const zip = new JSZip();

zip.generateAsync({ type: "object" }).then(() => {

const downloadUrl = window.URL.createObjectURL(res);

const link = document.createElement("a");

link.href = downloadUrl;

link.setAttribute("download", `123test.zip`);

appendChild(link);

link.click();

// 释放 URL 对象

URL.revokeObjectURL(link.hrefs);

});

}

});

相关推荐
JeffongTan2 小时前
在LWC中镶嵌VF Page获取用户IP
前端·javascript·salesforce
phltxy2 小时前
C语言操作符详解
java·c语言·算法
毕竟是shy哥2 小时前
vs code连接远程服务器docker环境及配置免密登录
服务器·docker·vs code
步行cgn3 小时前
@Configuration 详解:Spring 配置类的核心注解
java·后端·spring
徐小黑ACG3 小时前
nginx配置文件
linux·服务器·nginx
sunshine22 girl3 小时前
Java学习一 环境配置2 安装和基本使用Idea
java·学习·intellij-idea
新时代牛马3 小时前
Linux VFS 完整篇:从path_openat、dentry/inode 到page cache 与挂载排障
linux·运维·服务器
陆枫Larry4 小时前
Astro 是什么
前端
嘿嘿-665 小时前
Windows 一键使用 GPT-6 Astra:Codex CLI 配置教程
java·人工智能·windows·gpt·chatgpt·web
是立不是利5 小时前
写给设计师的 CSS 博客美学指南
前端·css