在小程序onLoad事件中使用getItems(this) 和this.getItems()

getItems(this)对应的方法为

微信小程序使用async await的一些技巧

 

 this.getItems()对应的方法为

微信小程序使用async await的一些技巧

在getItems(this)中使用await获取的返回数据在调试状态是undefined,但是下面是能用的

微信小程序使用async await的一些技巧

 

 在this.getItems()中使用await获取的返回数据在调试状态下是正确的

在this.getItems()可以直接使用this

建议使用this.getItems()

相关文章:

  • 2021-11-25
  • 2021-06-04
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
  • 2021-04-03
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
  • 2022-12-23
相关资源
相似解决方案