js把json数据导出为csv文件
2017-10-10 本文已影响0人
louhangfei
先占坑
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();