Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
fix(api): api
Browse files Browse the repository at this point in the history
getDefaultColWidth/getDefaultRowHeight
  • Loading branch information
mengshukeji committed Oct 22, 2020
1 parent 4fe7de2 commit 14d72eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion docs/zh/guide/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
- **参数**

- {PlainObject} [setting]: 可选参数
+ {Number} [order]: 工作表下标;默认值为当前工作表下标
+ {Function} [success]: 操作结束的回调函数

- **说明**
Expand All @@ -660,7 +661,8 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
- **参数**

- {PlainObject} [setting]: 可选参数
+ {Function} [success]: 操作结束的回调函数
+ {Number} [order]: 工作表下标;默认值为当前工作表下标
+ {Function} [success]: 操作结束的回调函数

- **说明**

Expand Down
10 changes: 7 additions & 3 deletions src/global/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1378,10 +1378,12 @@ export function getColumnWidth(columnInfo, options = {}) {
/**
* 获取工作表的默认行高
* @param {Object} options 可选参数
* @param {Number} options.order 工作表索引;默认值为当前工作表索引
* @param {Function} options.success 操作结束的回调函数
*/
export function getDefaultRowHeight(options = {}) {
let {
order = getSheetIndex(Store.currentSheetIndex),
success
} = {...options}

Expand All @@ -1391,17 +1393,19 @@ export function getDefaultRowHeight(options = {}) {
}
}, 1)

return Store.defaultrowlen;
return Store.luckysheetfile[order].defaultRowHeight;
}


/**
* 获取工作表的默认列宽
* @param {Object} options 可选参数
* @param {Number} options.order 工作表索引;默认值为当前工作表索引
* @param {Function} options.success 操作结束的回调函数
*/
export function getDefaultColumnWidth(options = {}) {
export function getDefaultColWidth(options = {}) {
let {
order = getSheetIndex(Store.currentSheetIndex),
success
} = {...options}

Expand All @@ -1411,7 +1415,7 @@ export function getDefaultColumnWidth(options = {}) {
}
}, 1)

return Store.defaultcollen;
return Store.luckysheetfile[order].defaultColWidth;
}


Expand Down

0 comments on commit 14d72eb

Please sign in to comment.