如何在一个页面里读取多个集合的数据
- 我的首页有两个展示用的模块,然后每个模块各有一个数据库的集合,我想在onload里面读取集合的时候,可以同时读取到两个集合,现在只能读到一个
以下是代码
onLoad: function (options) { var that=this; /*获取云数据*/ db.collection('post_info').limit(3).orderBy('date','desc').get({ success(res){ that.setData({ postlist:res.data }) console.log(res.data) } }) }, |
- 跪谢各位大佬搭救一下小白
