onReady:function(){
var query = new AV.Query("goods")
query.find().then(function (goods) {
var goods_data = []
for (var index in goods) {
goods_data.push(goods[index])
}
this.setData({ goods_data })
})
},
我想将请求过来的数据倒序,本来打算在函数中排序后在setData上去,但是发现根本set不到。
然后我用了很多办法,发现then获取数据总数在最后的。
后来我又用了.then().then()的方法,第一个then设置数据,第二个then拿数据排序,但发现在function里面就是拿不到this.data的数据。
求指教
-
创建时间
18年1月3日
-
最后回复
18年1月3日
-
4
回复
-
2.0K
浏览
-
3
用户
-
2
链接