-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
options #108
base: master
Are you sure you want to change the base?
options #108
Conversation
2、options增加filterRows、filterCols、函数,过滤出想要显示的行和列 3、options的widthOffset、heightOffset 也可以是函数(特定的行列的宽高偏移值可能不同) 4、options增加getCellText,(内置的getCellText函数考虑的情况不足应对所有情况)
@@ -318,14 +352,17 @@ export function transferExcelToSpreadSheet(workbook, options){ | |||
|
|||
transferColumns(sheet,sheetData, options); | |||
// 遍历行 | |||
(sheet._rows || []).forEach((row,spreadSheetRowIndex) =>{ | |||
//(sheet._rows || []).forEach((row,spreadSheetRowIndex) =>{ | |||
const rowsNewT = filter_with(sheet._rows || [], options.filterRows); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filterRows的作用是什么,过滤之后后续数据如何处理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
比如①一个excel文件有100行和100列,但只想预览 第10-20行,第30-40列的内容。
②一个excel文件有内容的行只有10行10列,但exceljs在读取这个文件时,却返回了几万列。
filterRows和filterCols用于从exceljs读取后的行列中取出只想预览的那些行列。
感觉有的地方不是很理想: 1、options增加minRowLength (有minColLength 但没有minRowLength 说不过去吧) --- 较合理 |
4、options增加getCellText,(内置的getCellText函数考虑的情况不足应对所有情况) --- 看起来可以,但是实际如果这么用的话,使用者要进行各种繁琐的处理,估计一般人搞不定,咱们这个库本来就是给小白用户用的 |
1、options增加minRowLength (有minColLength 但没有minRowLength 说不过去吧)
2、options增加filterRows、filterCols、函数,过滤出想要显示的行和列
3、options的widthOffset、heightOffset 也可以是函数(特定的行列的宽高偏移值可能不同)
4、options增加getCellText,(内置的getCellText函数考虑的情况不足应对所有情况)