// txt文件导出
/*
*需要导出的数组内容
*val
*/
onClickDownDaily(val) {
let title = "图片资源链接";
let str = "";
val.forEach((item, index) => {
str += `地址-${index + 1}:${item}\r\n`;
});
let allStr = title + "\r\n" + "\r\n" + str;
let export_blob = new Blob([allStr]);
let save_link = document.createElement("a");
save_link.href = window.URL.createObjectURL(export_blob);
save_link.download = "批量复制链接" + ".txt";
this.fakeClick(save_link);
},
fakeClick(obj) {
let ev = document.createEvent("MouseEvents");
ev.initMouseEvent(
"click",
true,
false,
window,
0,
0,
0,
0,
0,
false,
false,
false,
false,
0,
null
);
obj.dispatchEvent(ev);
},
09-02
3168
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-11