10金币
最佳答案//百度的代码,测试可行,供参考
var data=[{"id":"1","name":"张三"},{"id":"2","name":"李四"}]
exportXlsx(data)
function exportXlsx(data) {
var filename = "write.xlsx";
var ws_name = "SheetJS";
var wb = XLSX.utils.book_new();
var ws = XLSX.utils.json_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, ws_name);
XLSX.writeFile(wb, filename);
}
//https:// ...
| |
| |
| |
| |