打包下载怎么实现?

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

});

}

});

相关推荐
l***46681 天前
SSM与Springboot是什么关系? -----区别与联系
java·spring boot·后端
稚辉君.MCA_P8_Java1 天前
Gemini永久会员 快速排序(Quick Sort) 基于分治思想的高效排序算法
java·linux·数据结构·spring·排序算法
I***t7161 天前
【MyBatis】spring整合mybatis教程(详细易懂)
java·spring·mybatis
YA3331 天前
mcp-grafana mcp 使用stdio报错
java·开发语言
z***02601 天前
SpringBoot创建动态定时任务的几种方式
java·spring boot·spring
于齐龙1 天前
服务器常见问题-FAQ
服务器
i听风逝夜1 天前
Web 3D地球实时统计访问来源
前端·后端
正在努力的小河1 天前
Linux 块设备驱动实验
linux·运维·服务器
w***95491 天前
VScode 开发 Springboot 程序
java·spring boot·后端
iMonster1 天前
React 组件的组合模式之道 (Composition Pattern)
前端