js把json数据导出为csv文件

先占坑

    let _temp = header + result2;
    const blob = new Blob([`\ufeff${_temp}`], { type: 'text/csv,charset=UTF-8' });
    const csvUrl = URL.createObjectURL(blob);
    let link = document.createElement('a');
    link.download = `${title}.csv`;
    link.href = csvUrl;
    link.click();

你可能感兴趣的:(js把json数据导出为csv文件)