Browse Source

docs(api): api

1.add api
docs:setRowHeight/setColumnWidth/setSheetZoom/setDataVerification/deleteDataVerification/setProtection
master
mengshukeji 5 years ago
parent
commit
047dfeebd4
  1. 131
      docs/guide/api.md
  2. 19
      docs/guide/config.md
  3. 132
      docs/zh/guide/api.md
  4. 19
      docs/zh/guide/config.md

131
docs/guide/api.md

@ -541,6 +541,54 @@ Use note:
------------
### setRowHeight(rowInfo [,setting])
(TODO)
- **Parameter**
- {Object} [rowInfo]: Correspondence between number of rows and height
- {PlainObject} [setting]: optional parameters
+ {Number} [order]: Worksheet subscript; the default value is the current worksheet subscript
+ {Function} [success]: callback function for the end of the operation
- **Explanation**
Set the height of the specified ~~row~~
- **Usage**:
- Set the height of the first row to 50px and the height of the second row to 60px
`luckysheet.setRowHeight({0:50,1:60})`
------------
### setColumnWidth(columnInfo [,setting])
(TODO)
- **Parameter**
- {Number} [columnInfo]: Correspondence between the number of columns and the width
- {PlainObject} [setting]: optional parameters
+ {Number} [order]: Worksheet subscript; the default value is the current worksheet subscript
+ {Function} [success]: callback function for the end of the operation
- **Explanation**
Set the width of the specified column
- **Usage**:
- Set the width of the first column to 50px and the width of the second column to 60px
`luckysheet.setColumnWidth({0:50,1:60})`
------------
## Selection operation
### getRange()
@ -2013,6 +2061,32 @@ Use note:
------------
### setSheetZoom(zoom [,setting])
[todo]
- **Parameter**
- {Number} [zoom]: Worksheet zoom ratio
- {PlainObject} [setting]: optional parameters
+ {Function} [success]: callback function for the end of the operation
- **Explanation**
Set worksheet zoom ratio
- **Usage**:
- Set the current worksheet zoom ratio to 0.5
```js
luckysheet.setSheetZoom(0.5)
```
------------
### showGridLines([setting])
- **Parameter**
@ -2295,6 +2369,63 @@ Use note:
------------
## Data Verification
### setDataVerification(option, [setting])
[todo]
- **Parameter**
- {Object} [option]: Configuration information for data verification
- {PlainObject} [setting]: optional parameters
+ {Array | Object | String} [range]: The selection area for data verification, The format of the supported selection is `"A1:B2"`, `"sheetName!A1:B2"` or `{row:[0,1] ,column:[0,1]}`, can only be a single selection; the default is the current selection
+ {Number} [order]: Worksheet subscript; the default value is the current worksheet subscript
+ {Function} [success]: callback function for the end of the operation
- **Explanation**
Specify the worksheet range to set the data verification function and set the parameters
------------
### deleteDataVerification([setting])
[todo, to be confirmed whether it is reasonable]
- **Parameter**
- {PlainObject} [setting]: optional parameters
+ {Array | Object | String} [range]: The selection area for data verification, The format of the supported selection is `"A1:B2"`, `"sheetName!A1:B2"` or `{row:[0,1] ,column:[0,1]}`, can only be a single selection; the default is the current selection
+ {Number} [order]: Worksheet subscript; the default value is the current worksheet subscript
+ {Function} [success]: callback function for the end of the operation
- **Explanation**
Specify the worksheet range to delete the data verification function
------------
## Worksheet Protection
### setProtection(option, [setting])
[todo]
- **Parameter**
- {Object} [option]: Configuration information for worksheet protection
- {PlainObject} [setting]: optional parameters
+ {Number} [order]: Worksheet subscript; the default value is the current worksheet subscript
+ {Function} [success]: callback function for the end of the operation
- **Explanation**
Specify the worksheet to set the worksheet protection
------------
## Public method
### transToCellData(data [,setting])<div id='transToCellData'></div>

19
docs/guide/config.md

@ -743,6 +743,25 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura
- {String} [oldColor]: Before modification, the current worksheet color
- {String} [newColor]: After modification, the current worksheet color
------------
### sheetZoomBefore
- Type: Function
- Default: null
- Usage: Before worksheet zoom
- Parameter:
- {Number} [i]: `index` of current worksheet
- {String} [zoom]: Current worksheet zoom ratio
------------
### sheetZoomAfter
- Type: Function
- Default: null
- Usage: After worksheet zoom
- Parameter:
- {Number} [i]: `index` of current worksheet
- {String} [oldZoom]: Before modification, the current worksheet zoom ratio
- {String} [newZoom]: After modification, the current worksheet zoom ratio
------------
## Workbook

132
docs/zh/guide/api.md

@ -543,6 +543,54 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
------------
### setRowHeight(rowInfo [,setting])
(TODO)
- **参数**
- {Object} [rowInfo]: 行数和高度对应关系
- {PlainObject} [setting]: 可选参数
+ {Number} [order]: 工作表下标;默认值为当前工作表下标
+ {Function} [success]: 操作结束的回调函数
- **说明**
设置指定行的高度
- **示例**:
- 设置第一行高度为50px,第二行高度为60px
`luckysheet.setRowHeight({0:50,1:60})`
------------
### setColumnWidth(columnInfo [,setting])
(TODO)
- **参数**
- {Number} [columnInfo]: 列数和宽度对应关系
- {PlainObject} [setting]: 可选参数
+ {Number} [order]: 工作表下标;默认值为当前工作表下标
+ {Function} [success]: 操作结束的回调函数
- **说明**
设置指定列的宽度
- **示例**:
- 设置第一列宽度为50px,第二列宽度为60px
`luckysheet.setColumnWidth({0:50,1:60})`
------------
## 选区操作
### getRange()
@ -1960,6 +2008,32 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
------------
### setSheetZoom(zoom [,setting])
[todo]
- **参数**
- {Number} [zoom]: 工作表缩放比例
- {PlainObject} [setting]: 可选参数
+ {Function} [success]: 操作结束的回调函数
- **说明**
设置工作表缩放比例
- **示例**:
- 设置当前工作表缩放比例为0.5
```js
luckysheet.setSheetZoom(0.5)
```
------------
### showGridLines([setting])
- **参数**
@ -2242,6 +2316,63 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
------------
## 数据验证
### setDataVerification(option, [setting])
[todo]
- **参数**
- {Object} [option]: 数据验证的配置信息
- {PlainObject} [setting]: 可选参数
+ {Array | Object | String} [range]: 数据验证的选区范围,支持选区的格式为`"A1:B2"`、`"sheetName!A1:B2"`或者`{row:[0,1],column:[0,1]}`,只能为单个选区;默认为当前选区
+ {Number} [order]: 工作表下标;默认值为当前工作表下标
+ {Function} [success]: 操作结束的回调函数
- **说明**
指定工作表范围设置数据验证功能,并设置参数
------------
### deleteDataVerification([setting])
[todo,待确认是否合理]
- **参数**
- {PlainObject} [setting]: 可选参数
+ {Array | Object | String} [range]: 数据验证的选区范围,支持选区的格式为`"A1:B2"`、`"sheetName!A1:B2"`或者`{row:[0,1],column:[0,1]}`,只能为单个选区;默认为当前选区
+ {Number} [order]: 工作表下标;默认值为当前工作表下标
+ {Function} [success]: 操作结束的回调函数
- **说明**
指定工作表范围删除数据验证功能
------------
## 工作表保护
### setProtection(option, [setting])
[todo]
- **参数**
- {Object} [option]: 工作表保护的配置信息
- {PlainObject} [setting]: 可选参数
+ {Number} [order]: 工作表下标;默认值为当前工作表下标
+ {Function} [success]: 操作结束的回调函数
- **说明**
指定工作表设置工作表保护功能
------------
## 公共方法
### transToCellData(data [,setting])<div id='transToCellData'></div>
@ -2286,6 +2417,7 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
------------
## 旧版API
::: warning

19
docs/zh/guide/config.md

@ -744,6 +744,25 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- {String} [oldColor]: 修改前当前sheet页颜色
- {String} [newColor]: 修改后当前sheet页颜色
------------
### sheetZoomBefore
- 类型:Function
- 默认值:null
- 作用:sheet缩放前
- 参数:
- {Number} [i]: sheet页的`index`
- {String} [zoom]: 当前sheet页缩放比例
------------
### sheetZoomAfter
- 类型:Function
- 默认值:null
- 作用:sheet缩放后
- 参数:
- {Number} [i]: sheet页的`index`
- {String} [oldZoom]: 修改前当前sheet页缩放比例
- {String} [newZoom]: 修改后当前sheet页缩放比例
------------
## 工作簿

Loading…
Cancel
Save