Function
createExcel
(sheetTitle: string, columns: ExcelJS.Column[], tableData: T[])
Source from the content-addressed store, hash-verified
| 5 | |
| 6 | export const useExcelExport = <T>() => { |
| 7 | const createExcel = (sheetTitle: string, columns: ExcelJS.Column[], tableData: T[]) => { |
| 8 | const workBook = new ExcelJS.Workbook() |
| 9 | const sheet = workBook.addWorksheet(sheetTitle || $t('默认工作表')) |
| 10 | sheet.columns = columns |
| 11 | sheet.addRows(tableData) |
| 12 | return workBook |
| 13 | } |
| 14 | |
| 15 | const exportExcel = async ( |
| 16 | fileTitle: string, |
Tested by
no test coverage detected