New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

igroot-export-excel

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

igroot-export-excel

导出 excel 格式化

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

导出 Excel 数据组件

何时使用

需要导出 excel 数据到表格中,导出的数据是个二维数组,同时希望定义导出的二维数据的表头。

安装方法(请修改您的业务组件的安装方法)

  sl add -c igroot-export-excel

API

<IgrootExportExcel 
  fileName="文件名"
  sheetName="表名"
  columns={columns}
  dataSource={dataSource}
>
  <Button> 导出数据 </Button>
</IgrootExportExcel>

属性

参数说明类型默认值
style样式Object-
className扩展样式类名string-
autoPreview是否预览booleanfalse
columns导出的表头设置array-
dataSource导出的数据array-
onImportSuccess导入成功的回调函数function-

style: PropTypes.object, className: PropTypes.string, autoPreview: PropTypes.bool, fileName: PropTypes.string, sheetName: PropTypes.string, columns: PropTypes.array, dataSource: PropTypes.array

columns

const columns = [{
  title: '姓名',
  dataIndex: 'name',
  key: 'name',
}, {
  title: '年龄',
  dataIndex: 'age',
  key: 'age',
}, {
  title: '住址',
  dataIndex: 'address',
  key: 'address',
}]

Keywords

igroot

FAQs

Package last updated on 20 Jul 2018

Related posts