diff --git a/docs/guide/FAQ.md b/docs/guide/FAQ.md index fbdb8b54c..d1edb767c 100644 --- a/docs/guide/FAQ.md +++ b/docs/guide/FAQ.md @@ -267,4 +267,12 @@ In this case, after Luckysheet is modified in real time, the changes can be seen **A** 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')` +------------ + +## **Q** Why does the create callback have no effect? + +**A** 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) + ------------ \ No newline at end of file diff --git a/docs/zh/guide/FAQ.md b/docs/zh/guide/FAQ.md index 58c0f38ac..89a575dd1 100644 --- a/docs/zh/guide/FAQ.md +++ b/docs/zh/guide/FAQ.md @@ -268,4 +268,12 @@ Luckysheet教程里采用的CDN链接是 [jsdelivr](https://www.jsdelivr.com/pac **A** 前面加一个单引号就行,会强制识别为字符串,和excel表现一致的。比如:`'=currentDate('YYYY-MM-DD')` +------------ + +## **Q** create回调为什么没有效果? + +**A** API 方法`luckysheet.create()`这个方法没有回调,但是Luckysheet提供了钩子函数用于在指定位置执行回调方法,比如: +- 表格创建之前触发 [workbookCreateBefore](/zh/guide/config.html#workbookcreatebefore) +- 表格创建之后触发 [workbookCreateAfter](/zh/guide/config.html#workbookcreateafter) + ------------ \ No newline at end of file diff --git a/src/global/api.js b/src/global/api.js index 7554a29c3..7f84e12fb 100644 --- a/src/global/api.js +++ b/src/global/api.js @@ -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; })