从一个页面A传递参数id到另一个页面B,以下是页面B的代码,where语句的参数为常量比如 id:1时能返回数据,如果是变量options.id返回不了数据,请帮忙指教,多谢
onLoad: function (options) {
if (options.id) {
const db = wx.cloud.database({
env: 'yunlv'
});
db.collection('poetry')
.where({
id: options.id
})
.orderBy("id", "desc")
.get()
.then(res=>{
console.log("poetry item : ",res.data)
})
}
},
相似问题