mirror of
https://github.com/501351981/vue-office.git
synced 2025-07-25 07:41:42 +08:00
fix: excel空白行导致行数计算错误问题
This commit is contained in:
parent
b0d5e3889f
commit
f6541f6629
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@js-preview/excel",
|
"name": "@js-preview/excel",
|
||||||
"type" :"module",
|
"type" :"module",
|
||||||
"version": "1.4.0",
|
"version": "1.4.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vue-office/excel",
|
"name": "@vue-office/excel",
|
||||||
"version": "1.4.0",
|
"version": "1.4.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -344,7 +344,7 @@ function getStyle(cell){
|
|||||||
|
|
||||||
export function transferExcelToSpreadSheet(workbook, options){
|
export function transferExcelToSpreadSheet(workbook, options){
|
||||||
let workbookData = [];
|
let workbookData = [];
|
||||||
console.log(workbook, 'workbook');
|
// console.log(workbook, 'workbook');
|
||||||
workbook.eachSheet((sheet) => {
|
workbook.eachSheet((sheet) => {
|
||||||
//console.log(sheet,'sheet');
|
//console.log(sheet,'sheet');
|
||||||
// 构造x-data-spreadsheet 的 sheet 数据源结构
|
// 构造x-data-spreadsheet 的 sheet 数据源结构
|
||||||
@ -394,7 +394,7 @@ export function transferExcelToSpreadSheet(workbook, options){
|
|||||||
if(sheetData._media){
|
if(sheetData._media){
|
||||||
sheetData.media = 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);
|
workbookData.push(sheetData);
|
||||||
});
|
});
|
||||||
//console.log(workbookData, 'workbookData')
|
//console.log(workbookData, 'workbookData')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user