Browse Source

fix(tojson): bug

1.toJson API bug 2.update FAQ
master
mengshukeji 5 years ago
parent
commit
1c94783677
  1. 8
      docs/guide/FAQ.md
  2. 8
      docs/zh/guide/FAQ.md
  3. 2
      src/global/api.js

8
docs/guide/FAQ.md

@ -268,3 +268,11 @@ In this case, after Luckysheet is modified in real time, the changes can be seen
**<span style="font-size:20px;">A</span>** Just add a single quotation mark in front of it, and it will be forcibly recognized as a string, which is consistent with excel. For example: `'=currentDate('YYYY-MM-DD')` **<span style="font-size:20px;">A</span>** Just add a single quotation mark in front of it, and it will be forcibly recognized as a string, which is consistent with excel. For example: `'=currentDate('YYYY-MM-DD')`
------------ ------------
## **<span style="font-size:20px;">Q</span>** Why does the create callback have no effect?
**<span style="font-size:20px;">A</span>** The API method `luckysheet.create()` does not have a callback, but Luckysheet provides a hook function to execute the callback method at a specified location, such as:
- Triggered before the workbook is created [workbookCreateBefore](/guide/config.html#workbookcreatebefore)
- Triggered after the workbook is created [workbookCreateAfter](/guide/config.html#workbookcreateafter)
------------

8
docs/zh/guide/FAQ.md

@ -269,3 +269,11 @@ Luckysheet教程里采用的CDN链接是 [jsdelivr](https://www.jsdelivr.com/pac
**<span style="font-size:20px;">A</span>** 前面加一个单引号就行,会强制识别为字符串,和excel表现一致的。比如:`'=currentDate('YYYY-MM-DD')` **<span style="font-size:20px;">A</span>** 前面加一个单引号就行,会强制识别为字符串,和excel表现一致的。比如:`'=currentDate('YYYY-MM-DD')`
------------ ------------
## **<span style="font-size:20px;">Q</span>** create回调为什么没有效果?
**<span style="font-size:20px;">A</span>** API 方法`luckysheet.create()`这个方法没有回调,但是Luckysheet提供了钩子函数用于在指定位置执行回调方法,比如:
- 表格创建之前触发 [workbookCreateBefore](/zh/guide/config.html#workbookcreatebefore)
- 表格创建之后触发 [workbookCreateAfter](/zh/guide/config.html#workbookcreateafter)
------------

2
src/global/api.js

@ -6261,7 +6261,7 @@ export function toJson(){
getluckysheetfile().forEach((file,index)=>{ getluckysheetfile().forEach((file,index)=>{
toJsonOptions.data[index].row = file.data.length; toJsonOptions.data[index].row = file.data.length;
toJsonOptions.data[index].column = file.data[0].length; toJsonOptions.data[index].column = getObjType(file.data[0]) === 'array' ? file.data[0].length : 0;
}) })

Loading…
Cancel
Save