- 在onload里面写查数据库,查询结果却在onready之后,求大佬讲解一下
如下图所示,在onload里写的查数据库的方法,却在onready之后打印出结果 [图片]具体方法如下: onLoad:function(options){ this.searchInfo() }, searchInfo:function(){ console.log("onshow....") const db = wx.cloud.database() console.log("onshow111") db.collection('problem').where({ _openid: this.data.openid, }).get({ success: res => { this.setData({ items: JSON.stringify(res.data, null, 2) }) console.log("123:", this.data.items) }, fail: err => { wx.showToast({ icon: 'none', title: '查询记录失败' }) } }) }
2018-09-30 - 云开发demo里面添加数据
- 当前 Bug 的表现(可附上截图) [数据库] [新增记录] 失败: Error: errCode: -1 | errMsg: collection.add:fail operateWXData:fail system error; at collection.add api; at new t (WACloud.js:1) at u (WACloud.js:1) at Object.t.returnAsFinalCloudSDKError (WACloud.js:1) at t.<anonymous> (WACloud.js:1) at WACloud.js:1 at Object.throw (WACloud.js:1) at o (WACloud.js:1) at <anonymous> [图片] - 预期表现 - 复现路径 - 提供一个最简复现 Demo 官方demo
2018-09-28