我正在从代码中下载一个csv文件,但是它跳过了第一个字符串,因此所有列都被一个关闭了。为什么会这样?
console.log("download csv", csv); //this contains the string that is being ignored during download
var element = document.createElement('a');
element.setAttribute('href', 'data:text/csv;charset=utf-8' + encodeURI(csv));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);