json字符转换为Excel的解决方案
import init, { json2excel } from 'aixi_excel';
function download_blob(blob, file_type) {
const a = document.createElement('a')
const objectUrl = URL.createObjectURL(blob)
a.href = objectUrl
var t = new Date().getTime();
a.download = t + "." + file_type;
a.click();
URL.revokeObjectURL(objectUrl);
}
function aixi_json() {
console.log("aixi_json");
init().then(() => {
var blob = json2excel(JSON.stringify([
{ "Aixi": "aixi" }
]));
download_blob(blob, "xlsx");
});
}