感谢两位的回答!
onShow: function () {
var that = this;
var newslist = [];
var query = new AV.Query('News');
query.equalTo('class', '通知');
try{
query.find().then((results) => {
newslist = JSON.stringify(results);
newslist = JSON.parse(newslist);
that.formatDate(newslist);
that.setData({
news: newslist
})
})
} catch(e){
console.log('err:' + e);
}
}
问题就在query.find()