This commit is contained in:
xuliangzhan
2020-10-25 21:51:11 +08:00
parent d4e88e3dfa
commit 91b3dc45c4
2 changed files with 3 additions and 3 deletions

View File

@@ -226,8 +226,8 @@ function importXLSX (params: InterceptorImportParams) {
})
const workbook = XLSX.read(e.target.result, { type: 'binary' })
const rest = XLSX.utils.sheet_to_json(XEUtils.first(workbook.Sheets))
const fields = XEUtils.keys(rest.slice(0, 1)[0])
const list = rest.slice(1)
const fields = rest ? XEUtils.keys(rest[0]) : []
const list = rest
const status = checkImportData(tableFields, fields)
if (status) {
const records: any[] = list.map(item => {

View File

@@ -1,6 +1,6 @@
{
"name": "vxe-table-plugin-export-xlsx",
"version": "2.0.4",
"version": "2.0.5",
"description": "基于 vxe-table 的表格插件,支持导出 xlsx 格式",
"scripts": {
"lib": "gulp build"