- 大神帮忙看看,新手没搞懂,为什么list显示不出来?
js data: { openid: null, nickName: null, avatarUrl: '', list : [], }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { that = this; that.setData({ openid: options.openid, nickName: options.nickName, avatarUrl: options.avatarUrl }) that.information(); }, information: function (e) { db.collection('circle').where({ _openid: that.data.openid, }) .get({ success: function(res) { // res.data 是包含以上定义的两条记录的数组 console.log(res.data) console.log(res.data.length) if (res.data.length > 0) { console.log(res.data) for (var p = 0; p < res.data.length; p++) { var item = {}; item.time = res.data[p].time; item.value = p+1; item.content = res.data[p].content; console.log(item.content) list.push(item) } console.log(item) } } }) }, wxml <view wx:for="{{list}}" > {{item.content}} </view>
2022-08-13 - 为什么出现错误啊?大神帮忙看一下
[图片]
2022-07-18