fix: excel空白行导致行数计算错误问题

This commit is contained in:
liyulin 2023-08-25 11:45:27 +08:00
parent b0d5e3889f
commit f6541f6629
3 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
{
"name": "@js-preview/excel",
"type" :"module",
"version": "1.4.0",
"version": "1.4.1",
"description": "",
"main": "lib/index.js",
"files": [

View File

@ -1,6 +1,6 @@
{
"name": "@vue-office/excel",
"version": "1.4.0",
"version": "1.4.1",
"description": "",
"main": "lib/index.js",
"files": [

View File

@ -344,7 +344,7 @@ function getStyle(cell){
export function transferExcelToSpreadSheet(workbook, options){
let workbookData = [];
console.log(workbook, 'workbook');
// console.log(workbook, 'workbook');
workbook.eachSheet((sheet) => {
//console.log(sheet,'sheet');
// 构造x-data-spreadsheet 的 sheet 数据源结构
@ -394,7 +394,7 @@ export function transferExcelToSpreadSheet(workbook, options){
if(sheetData._media){
sheetData.media = sheetData._media;
}
sheetData.rows.len = Math.max(Object.keys(sheetData.rows).length, 100);
sheetData.rows.len = Math.max(Math.max(...Object.keys(sheetData.rows)) + 1, 100);
workbookData.push(sheetData);
});
//console.log(workbookData, 'workbookData')