diff --git a/README-zh.md b/README-zh.md
index 8e7ce1c..32eb4ed 100644
--- a/README-zh.md
+++ b/README-zh.md
@@ -157,13 +157,13 @@ npm run build
- 添加小编微信,拉你进Luckysheet开发者交流微信群,备注:加群
-
+
或者
- 加入Luckysheet开发者交流QQ群
-
+
[英文社群](./README.md)
diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js
index 3c6b023..e065cf8 100644
--- a/docs/.vuepress/config.js
+++ b/docs/.vuepress/config.js
@@ -84,7 +84,7 @@ module.exports = {
'/zh/guide/': [
'',
'config',
- 'data',
+ 'sheet',
'cell',
'operate',
'api',
diff --git a/docs/.vuepress/public/img/favicon.ico b/docs/.vuepress/public/favicon.ico
similarity index 100%
rename from docs/.vuepress/public/img/favicon.ico
rename to docs/.vuepress/public/favicon.ico
diff --git a/docs/.vuepress/public/img/QQ群二维码.jpg b/docs/.vuepress/public/img/QQ群二维码.jpg
new file mode 100644
index 0000000..5d6ed34
Binary files /dev/null and b/docs/.vuepress/public/img/QQ群二维码.jpg differ
diff --git a/docs/.vuepress/public/img/excel.png b/docs/.vuepress/public/img/excel.png
new file mode 100644
index 0000000..0f174eb
Binary files /dev/null and b/docs/.vuepress/public/img/excel.png differ
diff --git a/docs/.vuepress/public/img/微信二维码.jpg b/docs/.vuepress/public/img/微信二维码.jpg
new file mode 100644
index 0000000..3a3e74e
Binary files /dev/null and b/docs/.vuepress/public/img/微信二维码.jpg differ
diff --git a/docs/guide/FAQ.md b/docs/guide/FAQ.md
index 563e0b8..6f003d9 100644
--- a/docs/guide/FAQ.md
+++ b/docs/guide/FAQ.md
@@ -2,7 +2,7 @@
## What is the difference between data and celldata in luckysheetfile?
-**A**: Use one-dimensional array format [celldata](https://mengshukeji.github.io/LuckysheetDocs/guide/data.html), after the initialization is completed, the data converted into a two-dimensional array format is used for storage and update, and celldata is no longer used.
+**A**: Use one-dimensional array format [celldata](/zh/guide/sheet.html#celldata), after the initialization is completed, the data converted into a two-dimensional array format is used for storage and update, and celldata is no longer used.
If you need to take out data as initial data, you need to execute `luckysheet.getGridData(data)` to convert it to celldata data.
Among them, the celldata in `{ r, c, v }` format is converted to a two-dimensional array using `luckysheet.buildGridData(luckysheetfile)`, and the input parameter is the table data object `luckysheetfile`
@@ -20,7 +20,7 @@ luckysheet.buildGridData(luckysheetfile)
## What are the cell types?
-**A**: Refer to [Cell Format List](https://mengshukeji.github.io/LuckysheetDocs/guide/format.html), with examples of available cell formats
+**A**: Refer to [Cell Format List](/zh/guide/cell.html), with examples of available cell formats
------------
@@ -32,6 +32,6 @@ luckysheet.buildGridData(luckysheetfile)
## Why will the formula in the table not be triggered after initialization?
-**A** : Refer to [Table data format](https://mengshukeji.github.io/LuckysheetDocs/zh/guide/data.html#calcchain) ,just set the calcChain corresponding to the cell data.
+**A** : Refer to [Table data format](/zh/guide/sheet.html#calcchain) ,just set the calcChain corresponding to the cell data.
------------
\ No newline at end of file
diff --git a/docs/guide/README.md b/docs/guide/README.md
index 6e6c8dd..52edfdb 100644
--- a/docs/guide/README.md
+++ b/docs/guide/README.md
@@ -6,7 +6,7 @@ Luckysheet is an online spreadsheet like excel that is powerful, simple to confi
## Demo
[Online demo](https://mengshukeji.github.io/LuckysheetDemo/)
-
+
## Features
@@ -153,7 +153,7 @@ An example of a Luckysheet file is as follows, the table contains 3 sheets:`
luckysheetfile = [{sheet1 settings}, {sheet2 settings}, {sheet3 settings}]`
Equivalent to 3 sheets of excel
-
+
An example of a sheet in the file is as follows:
```javascript
diff --git a/docs/guide/api.md b/docs/guide/api.md
index 0048f9d..acfa2b7 100644
--- a/docs/guide/api.md
+++ b/docs/guide/api.md
@@ -9,7 +9,7 @@ The new API is being sorted out, please use it with caution!
- {Object} [options]:All configuration information of the table
- **Usage**:
- Initialize a luckysheet, which can contain multiple worksheets, refer to [Configuration List](https://mengshukeji.github.io/LuckysheetDocs/guide/config.html)
+ Initialize a luckysheet, which can contain multiple worksheets, refer to [Configuration List](/zh/guide/config.html)
------------
## luckysheet.getcellvalue([r] [,c] [,data] [,type])
@@ -33,7 +33,7 @@ The new API is being sorted out, please use it with caution!
## luckysheet.getluckysheetfile()
- **Usage**:
- Returns a one-dimensional array of all table data structures[luckysheetfile](https://mengshukeji.github.io/LuckysheetDocs/guide/data.html), `luckysheet.getluckysheetfile()[0]` can get all the information of the first worksheet.
+ Returns a one-dimensional array of all table data structures[luckysheetfile](/zh/guide/data.html), `luckysheet.getluckysheetfile()[0]` can get all the information of the first worksheet.
------------
## luckysheet.getconfig()
@@ -131,7 +131,7 @@ The new API is being sorted out, please use it with caution!
------------
## luckysheet.buildGridData(file)
- **Parameter**:
- - {Object} [file]:[luckysheetfile](https://mengshukeji.github.io/LuckysheetDocs/zh/guide/data.html#%E8%8E%B7%E5%8F%96%E8%A1%A8%E6%A0%BC%E6%95%B0%E6%8D%AE)
+ - {Object} [file]:[luckysheetfile](/zh/guide/sheet.html)
- **Usage**:
Generate a two-dimensional array that the table can recognize
diff --git a/docs/zh/guide/FAQ.md b/docs/zh/guide/FAQ.md
index d3b9f0e..3969bff 100644
--- a/docs/zh/guide/FAQ.md
+++ b/docs/zh/guide/FAQ.md
@@ -2,7 +2,7 @@
## luckysheetfile中的data和celldata有什么区别?
-**A** : 表格初始化时使用一维数组格式的 [celldata](https://mengshukeji.github.io/LuckysheetDocs/zh/guide/data.html#celldata),初始化完成后转化为二维数组格式的data作为存储更新使用,celldata不再使用。
+**A** : 表格初始化时使用一维数组格式的 [celldata](/zh/guide/sheet.html#celldata),初始化完成后转化为二维数组格式的data作为存储更新使用,celldata不再使用。
如果需要将data拿出来作为初始化数据,则需要执行 `luckysheet.getGridData(data)`转换为celldata数据。
其中`{ r, c, v }`格式的celldata转换为二维数组使用的是`luckysheet.buildGridData(luckysheetfile)`,传入参数为表格数据对象`luckysheetfile`
@@ -20,7 +20,7 @@ luckysheet.buildGridData(luckysheetfile)
## 单元格的类型有哪些?
-**A** : 参考[单元格格式列表](https://mengshukeji.github.io/LuckysheetDocs/zh/guide/format.html#%E5%8D%95%E5%85%83%E6%A0%BC%E6%A0%BC%E5%BC%8F),例举了可用的单元格格式
+**A** : 参考[单元格格式列表](/zh/guide/cell.html),例举了可用的单元格格式
------------
@@ -32,6 +32,6 @@ luckysheet.buildGridData(luckysheetfile)
## 为什么初始化后表格里面的公式不会被触发?
-**A** : 参考 [表格数据格式](https://mengshukeji.github.io/LuckysheetDocs/zh/guide/data.html#calcchain) ,设置单元格数据对应的calcChain即可。
+**A** : 参考 [表格数据格式](/zh/guide/sheet.html#calcchain) ,设置单元格数据对应的calcChain即可。
------------
\ No newline at end of file
diff --git a/docs/zh/guide/README.md b/docs/zh/guide/README.md
index 9088cb7..e7dfdd4 100644
--- a/docs/zh/guide/README.md
+++ b/docs/zh/guide/README.md
@@ -6,7 +6,7 @@ Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置
## Demo
[在线demo](https://mengshukeji.github.io/LuckysheetDemo/)
-
+
## 特性
@@ -153,7 +153,7 @@ npm run build
luckysheetfile = [ {sheet1设置}, {sheet2设置}, {sheet3设置} ]`
相当于excel的3个sheet
-
+
文件中的一个sheet的数据`luckysheetfile[0]`的结构如下:
```json
diff --git a/docs/zh/guide/api.md b/docs/zh/guide/api.md
index a8ecf9d..fff2e20 100644
--- a/docs/zh/guide/api.md
+++ b/docs/zh/guide/api.md
@@ -12,11 +12,11 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
### getCellValue(row, column [,setting])
- **参数**:
-
+
- {Number} [row]: 单元格所在行数;从0开始的整数,0表示第一行
- {Number} [column]: 单元格所在列数;从0开始的整数,0表示第一列
- {PlainObject} [setting]: 可选参数
- + {String} [type]: 单元格的值,可以设置为"v":原始值 或者"m":显示值;默认值为'v',表示获取单元格的实际值
+ + {String} [type]: 单元格的值类型,可以设置为原始值"v"或者显示值"m";默认值为'v',表示获取单元格的实际值
+ {Number} [order]: 工作表索引;默认值为当前工作表索引
- **说明**:
@@ -39,32 +39,34 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
### setCellValue(row, column, value [,setting])
-- **参数**:
- - {Number} [row]: 单元格所在行数;从0开始的整数,0表示第一行
- - {Number} [column]: 单元格所在列数;从0开始的整数,0表示第一列
- - {Object | String | Number} [value]: 要设置的值;可以为字符串或数字,或为符合Luckysheet单元格格式的对象,参考 [单元格属性表](https://mengshukeji.github.io/LuckysheetDocs/zh/guide/format.html#%E5%8D%95%E5%85%83%E6%A0%BC%E5%B1%9E%E6%80%A7%E8%A1%A8)
- - {PlainObject} [setting]: 可选参数
- + {Number} [order]: 工作表索引;默认值为当前工作表索引
- + {Function} [success]: 操作结束的回调函数
+- **参数**:
+
+ - {Number} [row]: 单元格所在行数;从0开始的整数,0表示第一行
+ - {Number} [column]: 单元格所在列数;从0开始的整数,0表示第一列
+ - {Object | String | Number} [value]: 要设置的值;可以为字符串或数字,或为符合Luckysheet单元格格式的对象,参考 [单元格属性表](/zh/guide/cell.html)
+ - {PlainObject} [setting]: 可选参数
+ + {Number} [order]: 工作表索引;默认值为当前工作表索引
+ + {Function} [success]: 操作结束的回调函数
-- **说明**:
+- **说明**:
- 设置某个单元格的值,也可以设置整个单元格对象,用于同时设置多个单元格属性
+ 设置某个单元格的值,也可以设置整个单元格对象,用于同时设置多个单元格属性
-- **示例**:
+- **示例**:
- - 设置当前工作表"A1"单元格的值为"abc"
- `luckysheet.setCellValue(0, 0, 'abc');`
+ - 设置当前工作表"A1"单元格的值为"abc"
+ `luckysheet.setCellValue(0, 0, 'abc');`
------------
### setCellFormat(row, column, attr, value [,setting])
- **参数**:
+
- {Number} [row]: 单元格所在行数;从0开始的整数,0表示第一行
- {Number} [column]: 单元格所在列数;从0开始的整数,0表示第一列
- - {String} [attr]: 属性类型,参考 [单元格属性表](https://mengshukeji.github.io/LuckysheetDocs/zh/guide/format.html#%E5%8D%95%E5%85%83%E6%A0%BC%E5%B1%9E%E6%80%A7%E8%A1%A8)的属性值
- - {String | Number | Object} [value]: 具体的设置值,一个属性会对应多个值,参考 [单元格属性表](https://mengshukeji.github.io/LuckysheetDocs/zh/guide/format.html#%E5%8D%95%E5%85%83%E6%A0%BC%E5%B1%9E%E6%80%A7%E8%A1%A8)的值示例,特殊情况:如果属性类型`attr`是单元格格式`ct`,则设置值`value`应提供`ct.fa`,比如设置A1单元格的格式为百分比格式:
+ - {String} [attr]: 属性类型,参考 [单元格属性表](/zh/guide/cell.html)的属性值
+ - {String | Number | Object} [value]: 具体的设置值,一个属性会对应多个值,参考 [单元格属性表](/zh/guide/cell.html)的值示例,特殊情况:如果属性类型`attr`是单元格格式`ct`,则设置值`value`应提供`ct.fa`,比如设置A1单元格的格式为百分比格式:
`luckysheet.setCellFormat(0, 0, "ct", "0.00%")`
@@ -109,12 +111,16 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
+ {Boolean} [isWholeWord]: 是否整词匹配;默认为 `false`
+ {Boolean} [isCaseSensitive]: 是否区分大小写匹配;默认为 `false`
+ {Number} [order]: 工作表索引;默认值为当前工作表索引
- + {Function} [success]: 操作结束的回调函数
- **说明**:
查找一个工作表中的指定内容,返回查找到的内容组成的单元格一位数组,数据格式同`celldata`。
+- **示例**:
+
+ - 当前工作表查找`"value"`字符串
+ `luckysheet.find("value")`
+
------------
### replace(content, replaceContent [,setting])
@@ -134,6 +140,11 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
查找一个工作表中的指定内容并替换成新的内容,返回替换后的内容组成的单元格一位数组,数据格式同`celldata`。
+- **示例**:
+
+ - 当前工作表查找`"value"`字符串并替换为`"out"`
+ `luckysheet.find("value", "out)`
+
------------
## 行和列操作
@@ -141,6 +152,7 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
### setHorizontalFrozen(isRange [,setting])
- **参数**:
+
- {Boolean} [isRange]: 是否冻结行到选区
`isRange`可能的值有:
@@ -157,11 +169,22 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
特别注意,只有在`isRange`设置为`true`的时候,才需要设置`setting`中的`range`。
+- **示例**:
+
+ - 冻结首行
+
+ `luckysheet.setHorizontalFrozen(false)`
+
+ - 冻结到`B5`选区
+
+ `luckysheet.setHorizontalFrozen(true, { range: 'B5' })`
+
------------
### setVerticalFrozen(isRange [,setting])
- **参数**:
+
- {Boolean} [isRange]: 是否冻结列到选区
`isRange`可能的值有:
@@ -178,11 +201,18 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
特别注意,只有在`isRange`设置为`true`的时候,才需要设置`setting`中的`range`。
+- **示例**:
+
+ - 冻结首列
+
+ `luckysheet.setVerticalFrozen(false)`
+
------------
### setBothFrozen(isRange [,setting])
- **参数**:
+
- {Boolean} [isRange]: 是否冻结行列到选区
`isRange`可能的值有:
@@ -199,6 +229,12 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
特别注意,只有在`isRange`设置为`true`的时候,才需要设置`setting`中的`range`。
+- **示例**:
+
+ - 冻结行列
+
+ `luckysheet.setBothFrozen(false)`
+
------------
### cancelFrozen([setting])
@@ -213,13 +249,19 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
取消冻结操作
+- **示例**:
+
+ - 取消冻结
+
+ `luckysheet.cancelFrozen()`
+
------------
### insertRow( row [,setting])
- **参数**:
- - {Number} [row]: 在第几行插入空白行
+ - {Number} [row]: 在第几行插入空白行,从0开始
- {PlainObject} [setting]: 可选参数
+ {Number} [number]: 插入的空白行数;默认为 1
@@ -230,6 +272,12 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
在第`row`行的位置,插入`number`行空白行
+- **示例**:
+
+ - 在第2行的位置插入1行空白行
+
+ `luckysheet.insertRow(1)`
+
------------
### insertColumn( column [,setting])
@@ -247,6 +295,12 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
在第`column`列的位置,插入`number`列空白列
+- **示例**:
+
+ - 在第1列的位置插入3行空白行
+
+ `luckysheet.insertRow(0, { number: 3 })`
+
------------
### deleteRow(rowStart, rowEnd [,setting])
@@ -264,7 +318,13 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
删除指定的行
- 特别提醒,删除行之后,行的序号并不会变化,注意观察数据是否被正确删除即可。
+ 特别提醒,删除行之后,行的序号并不会变化,下面的行会补充到上面,注意观察数据是否被正确删除即可。
+
+- **示例**:
+
+ - 删除2-4行
+
+ `luckysheet.deleteRow(1, 3)`
------------
@@ -283,7 +343,13 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
删除指定的列
- 特别提醒,删除列之后,列的序号并不会变化,注意观察数据是否被正确删除即可。
+ 特别提醒,删除列之后,列的序号并不会变化,右边的列会补充到左边,注意观察数据是否被正确删除即可。
+
+- **示例**:
+
+ - 删除2-4列
+
+ `luckysheet.deleteColumn(1, 3)`
------------
@@ -304,6 +370,12 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
特别提醒,隐藏行之后,行的序号会变化。
+- **示例**:
+
+ - 隐藏2-4行
+
+ `luckysheet.hideRow(1, 3)`
+
------------
### hideColumn(columnStart, columnEnd [,setting])(TODO)
@@ -323,6 +395,12 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
特别提醒,隐藏列之后,列的序号会变化。
+- **示例**:
+
+ - 隐藏2-4列
+
+ `luckysheet.hideColumn(1, 3)`
+
------------
### showRow(rowStart, rowEnd [,setting])
@@ -340,6 +418,12 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
显示指定的行
+- **示例**:
+
+ - 显示2-4行
+
+ `luckysheet.showRow(1, 3)`
+
------------
### showColumn(columnStart, columnEnd [,setting])(TODO)
@@ -357,6 +441,12 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
显示指定的列
+- **示例**:
+
+ - 显示2-4列
+
+ `luckysheet.showColumn(1, 3)`
+
------------
## 选区操作
@@ -379,7 +469,7 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
`luckysheet.getRange()`
则返回结果为:
- ```
+ ```json
[
{ "row": [0,1], "column": [0,1] },
{ "row": [3,4], "column": [1,2] }
@@ -400,7 +490,87 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
返回指定工作表指定范围的单元格二维数组数据,每个单元格为一个对象。
- [单元格对象格式参考](https://mengshukeji.github.io/LuckysheetDocs/zh/guide/format.html#%E5%8D%95%E5%85%83%E6%A0%BC%E5%B1%9E%E6%80%A7%E8%A1%A8)
+ [单元格对象格式参考](/zh/guide/cell.html)
+
+- **示例**:
+
+ - 当前选区为"A1:B2",执行
+
+ `luckysheet.getRangeValue()`
+
+ 则返回结果为:
+ ```json
+ [
+ [
+ {
+ "v": "vaule1",
+ "ct": {
+ "fa": "General",
+ "t": "g"
+ },
+ "m": "vaule1",
+ "bg": "rgba(255,255,255)",
+ "bl": 0,
+ "it": 0,
+ "ff": 1,
+ "fs": 11,
+ "fc": "rgb(51, 51, 51)",
+ "ht": 1,
+ "vt": 0
+ },
+ {
+ "v": "value3",
+ "ct": {
+ "fa": "General",
+ "t": "g"
+ },
+ "m": "value3",
+ "bg": "rgba(255,255,255)",
+ "bl": 0,
+ "it": 0,
+ "ff": 1,
+ "fs": 11,
+ "fc": "rgb(51, 51, 51)",
+ "ht": 1,
+ "vt": 0
+ }
+ ],
+ [
+ {
+ "v": "vaule2",
+ "ct": {
+ "fa": "General",
+ "t": "g"
+ },
+ "m": "vaule2",
+ "bg": "rgba(255,255,255)",
+ "bl": 0,
+ "it": 0,
+ "ff": 1,
+ "fs": 11,
+ "fc": "rgb(51, 51, 51)",
+ "ht": 1,
+ "vt": 0
+ },
+ {
+ "v": "value4",
+ "ct": {
+ "fa": "General",
+ "t": "g"
+ },
+ "m": "value4",
+ "bg": "rgba(255,255,255)",
+ "bl": 0,
+ "it": 0,
+ "ff": 1,
+ "fs": 11,
+ "fc": "rgb(51, 51, 51)",
+ "ht": 1,
+ "vt": 0
+ }
+ ]
+ ]
+ ```
------------
@@ -418,6 +588,38 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
特别注意,如果复制多个选区,这几个选区必须有相同的行或者相同的列才能复制,复制出的结果也会自动合并成衔接的数组,比如,多选`"C18:C20"` / `"E18:E20"` / `"G18:H20"`是允许的,但是多选`"C18:C20"` / `"E18:E21"`是不允许的
+- **示例**:
+
+ - 当前选区为"A1:B2",执行
+
+ `luckysheet.getRangeHtml()`
+
+ 则返回结果为:
+ ```html
+
| + value1 + | ++ value3 + | +
| + value2 + | ++ value4 + | +