onLoad: function(t) {
var e = this;
wx.request({
url: "http://www.xlczg.cn/api/index.php?m=jk&c=new",
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success:function(t) {
console.log(t.data);
e.setData({
news: t.data
});
}
})
}
<view class="li" wx:for="{{news}}" wx:key="key">
<navigator url="../article-detail/article-detail?id={{item.id}}">
<image src="http://www.xlczg.cn{{item.litpic}}"></image>
<text class="p">{{item.title}}</text>
</navigator>
</view>
console没有报错
wx:for="{{news.data}}"
https://developers.weixin.qq.com/s/w5g8e8mt7RfH
应该是that.setData吧?e.setData是啥?
news: t.data.data
news: t.data.data
})