前端调用微信云开发数据库中的数据后,怎么逐条显示?(大一菜鸟,刚刚接触小程序开发,目前只能全部显示)
const db = wx.cloud.database({}); const cont = db.collection( 'question_data' ); Page({ data: { ne:[], res: null , status: { A: false , B: false , C: false }, show_flag: false , id: 1, has_right: 0 }, onLoad: function (options) { var _this = this ; const db = wx.cloud.database(); db.collection( 'question_data' ).get({ success: res =>{ console.log(res.data) this .setData({ ne: res.data }) } }) }, }) |
< view class = 'a' wx:for = "{{ne}}" > < view >{{item.id}}.{{item.question}}</ view > < view bindtap = "choose" id = "A" >A.{{item.A}}{{status.A?'v':''}}</ view > < view bindtap = "choose" id = "B" >B.{{item.B}}{{status.B?'v':''}}</ view > < view bindtap = "choose" id = "C" >C.{{item.C}}{{status.C?'v':''}}</ view > </ view > |
现在只能把所有记录一起显示出来,求教如何显示某一记录。(上百度也找不到解决方案,应该怎么办)