调用后端api获得的json数据绑定data后wx:for渲染不出来?
wxml代码: <view wx:for="{{blogList}}">
{{item.id}}
</view>
js代码: Page({
data:{
blogList: [],
},
onLoad: function(){
this.getBlogData(1);
},
getBlogData(p){
const t = this;
wx.request({
url: 'https://api.damanyang.cn/blog/getByPage/'+p,
success: function(resp){
t.blogList = resp.data.content;
}
})
},
})