标签:for 实现 index 函数 The new async gen ++
npm下载jszip
npm install jszip
npm install file-saver
函数
import JSZip from "jszip";
import { saveAs } from "file-saver";
//data=[{index:xx, ..., blob:xx}{...}]
downAllRecord(data: any) {
let zip = new JSZip();//初始化
for (let i = 0; i < data.length; i++) {
let obj = data[i];
zip.file(obj.index + ".webm", obj.blob);
}
zip.generateAsync({ type: "blob" }).then(function(content: Blob) {
saveAs(content, "Sound.zip");//下载zip
});
}
标签:for 实现 index 函数 The new async gen ++
原文地址:https://www.cnblogs.com/xym4869/p/13367433.html