前端下载csv文件


var str = [

'ssssssssssssssssssssssssssssssssssssssss'

];

 


var uri = 'data:text/csv;charset=utf-8,%EF%BB%BF' + encodeURIComponent(str.join("\n"));
var downloadLink = document.createElement("a");
downloadLink.href = uri;
downloadLink.download = this.columnInfo.userAccount + "详单参数分值.csv";
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);

posted @ 2021-10-14 14:21  Steven_Rain  阅读(390)  评论(0编辑  收藏  举报