1金币
本帖最后由 Joestar.Xu 于 2023-8-24 11:23 编辑
集算表导出报Incorrect file format.
就算没有报错,导出来也是空的excel 。类似这样
导出代码
- download(){
- let _this = this;
- let excelIo = new spreadExcel.IO();
- let fileName = `excel_${new Date().getTime()}.xlsx`;
- let json = this.spread.toJSON();
- excelIo.save(
- json,
- function (blob) {
- saveAs(blob, fileName);
- },
- function (e) {
- _this.$message.error(e.errorMessage);
- },
- {
- includeBindingSource: true,
- }
- );
- }
复制代码 附件上传报错
|
最佳答案
查看完整内容
您好,请尝试以下代码:
download() {
let _this = this;
let excelIo = new spreadExcel.IO();
let fileName = `excel_${new Date().getTime()}.xlsx`;
let json = this.spread.toJSON({
includeBindingSource: true,
saveAsView: true,
});
excelIo.save(
json,
function (blob) {
saveAs(blob, fileName);
},
...
|