lowcode-engine icon indicating copy to clipboard operation
lowcode-engine copied to clipboard

关于页面生命周期中异步函数的疑问

Open ChiZng opened this issue 2 years ago • 1 comments

现象

组件生命周期函数componentDidMount 声明是异步函数,出码就报错了。 image image 我看是出码的时候把componentDidMount 函数名写死了,出码结果函数内容中有await但是方法名前面没有async。 这是故意这么设计的不让在生命周期函数中用await还是bug? image 然后无意中看到了源码面板介绍,有点懵了 image 我没有在读取schema中的originCode之后自己手动通过babel编译。发现好像也没什么问题。

ChiZng avatar Apr 18 '23 09:04 ChiZng

  1. async componentDidMount 确实是没支持,后面可以支持;
  2. 暂时没问题就先不管吧,后续有问题单独提个 issue;

LeoYuan avatar Apr 19 '23 03:04 LeoYuan