diff options
Diffstat (limited to 'lib/export.ts')
| -rw-r--r-- | lib/export.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/export.ts b/lib/export.ts index 71fae264..c4edbbc8 100644 --- a/lib/export.ts +++ b/lib/export.ts @@ -52,8 +52,8 @@ export async function exportTableToExcel<TData>( const maybeGroup = (col.columnDef.meta as any)?.group row1.push(maybeGroup ?? "") - // excelHeader - const maybeExcelHeader = (col.columnDef.meta as any)?.excelHeader + // excelHeader (meta 또는 직접 속성에서 찾기) + const maybeExcelHeader = (col.columnDef.meta as any)?.excelHeader || (col.columnDef as any)?.excelHeader if (typeof maybeExcelHeader === "string") { row2.push(maybeExcelHeader) } else { @@ -79,7 +79,7 @@ export async function exportTableToExcel<TData>( } else { // ────────────── 기존 1줄 헤더 ────────────── const headerRow = columns.map((col) => { - const maybeExcelHeader = (col.columnDef.meta as any)?.excelHeader + const maybeExcelHeader = (col.columnDef.meta as any)?.excelHeader || (col.columnDef as any)?.excelHeader return typeof maybeExcelHeader === "string" ? maybeExcelHeader : col.id }) |
