diff --git a/index.ts b/index.ts index a635029..7cf82c9 100644 --- a/index.ts +++ b/index.ts @@ -37,9 +37,13 @@ function getFooterData (opts: any, footerData: any[][]) { return footerFilterMethod ? footerData.filter((items, index) => footerFilterMethod({ items, $rowIndex: index })) : footerData } -function getFooterCellValue ($table: any, opts: any, rows: any[], column: any) { - const cellValue = getCellLabel(column, rows[$table.getVMColumnIndex(column)]) - return cellValue +function getFooterCellValue ($xeTable: any, opts: any, row: any, column: any) { + const _columnIndex = $xeTable.getVTColumnIndex(column) + // 兼容老模式 + if (XEUtils.isArray(row)) { + return getCellLabel(column, row[_columnIndex]) + } + return getCellLabel(column, XEUtils.get(row, column.field)) } declare module 'vxe-table' { diff --git a/package.json b/package.json index 761aff1..7fe80cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vxe-table-plugin-export-xlsx", - "version": "3.3.3", + "version": "3.3.4", "description": "基于 vxe-table 表格的扩展插件,支持导出 xlsx 格式", "scripts": { "lib": "gulp build"