1、看到很多人問小程序在用雲數據庫開發的時候,查詢出的數據沒辦法在其它地方使用。這中問題其實就是異步問題,具體請看下面代碼
const db = wx.cloud.database({}); let resCustomer =await db.collection('Customer').where({ //publish: _.eq(true) }).get() this.setData({ QCustomer: resCustomer.data })
請關注公眾號 “IT資源分享平台” 免費獲取更多學習資料