[BUG] luckysheet.setCellValue(0,0,1) error in the latest version 2.1.13

jslywgbw  于 3个月前  发布在  其他
关注(0)|答案(3)|浏览(66)

Describe the bug
Uncaught TypeError: Cannot read property '0' of undefined
at Object.Xh [as setCellValue] (api.js:103)
at HTMLDocument. (base.js:19)
at i (plugin.js:1)
at Object.fireWith [as resolveWith] (plugin.js:1)
at Function.ready (plugin.js:1)
at HTMLDocument.D (plugin.js:1)

To Reproduce

  1. The first step: initial luckysheet
  2. The second step: luckysheet.getSheet({"index": 0, "name": "Sheet1"});
  3. The third step: luckysheet.setCellValue(0,0, "test");
  4. See error: Uncaught TypeError: Cannot read property '0' of undefined

What is expected?
it would update the A1 value as "test" string.

Screenshots or demo
the same as the above error

Environment

  • OS: MAC OS
  • Browser Version: Chrome Version 131 (Official Build) (x86_64)
  • Luckysheet Version: 2.1.13

Additional context
Could you please look into this bug, this is a very critical bug.

thank you

Best,
Jinyu Chen

eh57zj3b

eh57zj3b1#

could you let me know which version can call the setCellValue() successful?

thank you

knsnq2tg

knsnq2tg2#

@Chenjinyu

我也遇到了这个问题,但是我在页面上等整个luckysheet加载完之后,在console里手动执行这行代码就可以work了。

我怀疑是代码执行到这里的时候sheet还没加载完

5uzkadbs

5uzkadbs3#

@Chenjinyu

在hook里面调用window.luckysheet.setCellValue()就行了。

hook: {
  workbookCreateAfter: () => {
    this.fillCellValue() // logic here
  }
}

相关问题