Function: exportXls

exportXls(data, name?, callBack?): boolean

导出Excel文件

Parameters

Name Type Default value Description
data Blob undefined 接口返回的blob数据
name? string 'excel' 导出的文件名(不带扩展名)
callBack? (result: ExportResult) => void undefined 导出结果回调函数

Returns

boolean

如果数据为空返回false,否则返回true

Description

将Blob数据导出为Excel文件,支持IE和其他现代浏览器

Throws

当data参数不是Blob类型时抛出

Example

exportXls(blobData, 'report', (result) => {
  if (result.type === 'success') {
    console.log('导出成功');
  } else {
    console.log(`导出失败: ${result.msg}`);
  }
});
ON THIS PAGE