小程序云数据库查询数据用在其它任意地方(完美解决)

1、看到很多人问小程序在用云数据库开发的时候,查询出的数据没办法在其它地方使用。这中问题其实就是异步问题,具体请看下面代码

 

 const db = wx.cloud.database({});
    let resCustomer =await db.collection('Customer').where({
      //publish: _.eq(true)
    }).get()
    this.setData({
      QCustomer: resCustomer.data
    })

          请关注公众号 “IT资源分享平台” 免费获取更多学习资料

原文地址:https://www.cnblogs.com/alex96/p/12807809.html