mounted(){
wx.cloud.init({
traceUser: true,
env:'ka-tset-pz57d'
});
const db = wx.cloud.database();
this.db.collection('readergoods').get().then(res=>{
console.log(res.data);
this.goodslists=res.data;
})
}
为什么我一运行就报错
Cannot read property 'collection' of undefined;at "pages/goods/main" page lifeCycleMethod onReady function
TypeError: Cannot read property 'collection' of undefined
catch 你能仔细点吗
this.db => db
TypeError: db.collection(...).get(...).then(...).cathc is not a function