diff --git a/index.ts b/index.ts index b0e9834..f5d94c5 100644 --- a/index.ts +++ b/index.ts @@ -33,9 +33,13 @@ function getCellText (cellValue: any) { return cellValue || ' ' } -function getFooterCellValue ($table: VxeTableConstructor, opts: VxeTablePropTypes.ExportConfig, rows: any[], column: VxeTableDefines.ColumnInfo) { - const cellValue = XEUtils.toValueString(rows[$table.getVTColumnIndex(column)]) - return getCellText(cellValue) +function getFooterCellValue ($xeTable: VxeTableConstructor, opts: VxeTablePropTypes.ExportConfig, row: any, column: VxeTableDefines.ColumnInfo) { + const _columnIndex = $xeTable.getVTColumnIndex(column) + // 兼容老模式 + if (XEUtils.isArray(row)) { + return getCellText(row[_columnIndex]) + } + return getCellText(XEUtils.get(row, column.field)) } function getFooterData (opts: VxeTablePropTypes.ExportConfig, footerData: any[][]) { diff --git a/package.json b/package.json index 44838b4..b026226 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vxe-table-plugin-export-pdf", - "version": "4.0.3", + "version": "4.0.4", "description": "基于 vxe-table 表格的扩展插件,支持导出 pdf 格式", "scripts": { "lib": "gulp build" @@ -53,7 +53,7 @@ "sass": "^1.55.0", "typescript": "^4.6.4", "vue": "^3.4.27", - "vxe-table": "^4.6.17" + "vxe-table": "^4.6.19" }, "peerDependencies": { "vxe-table": "^4.5.0"