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

Commit

Permalink
fix(tojson): bug
Browse files Browse the repository at this point in the history
1.toJson API bug 2.update FAQ
  • Loading branch information
mengshukeji committed Dec 16, 2020
1 parent e8ac0e2 commit 1c94783
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/guide/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,12 @@ 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;">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 changes: 8 additions & 0 deletions docs/zh/guide/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,12 @@ 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;">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 changes: 1 addition & 1 deletion src/global/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -6261,7 +6261,7 @@ export function toJson(){
getluckysheetfile().forEach((file,index)=>{

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;

})

Expand Down

0 comments on commit 1c94783

Please sign in to comment.