打包下载怎么实现?

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);

});

}

});

相关推荐
Java牛马几秒前
SpringBoot Starter 依赖相关总结
java·spring·springboot·starter·自动装配·依赖
吴声子夜歌14 分钟前
Java面试——Spring Cloud原理及应用(二)
java·spring cloud·面试
huainingning28 分钟前
R4930-G7服务器(RAID-LSI-9560-LP-8i-4GB)网页方式做Raid方法
服务器
东小西1 小时前
【SAA实战】第 1 篇:ReactAgent 入门——先撸个"会调工具的助手"跑起来
java·人工智能·spring
Profile排查笔记1 小时前
指纹浏览器哪个好?从 Profile、代理、权限和自动化能力判断是否适合
前端·人工智能·后端·自动化
mqiqe2 小时前
AgentScope Java 2.0 协议集成全景解析:A2A、AG-UI、Agent Protocol 三大开放协议实战指南
java·开发语言·ui
lzhdim2 小时前
12、JavaScript常见的内存泄露问题 - JavaScript学习系列文章
开发语言·前端·javascript·学习·ecmascript
denggun123452 小时前
yield
前端·数据库·python
前端snow2 小时前
ai agent -- prompt汇总
前端
脉动数据行情2 小时前
Java 实现台股 TWSE/TPEx 行情采集(个股 + K 线)
java·开发语言·twse·tpex·台股