1***@qq.com
1***@qq.com
  • 发布:2019-06-12 17:47
  • 更新:2019-06-12 17:47
  • 阅读:957

请求本地json数据问题

分类:uni-app

<div class="food" v-for="(value,index) in goodsList" v-if="value.state!==Nav && value.sid==activeKey">

getList(){
//接口请求数据
const requestTask = uni.request({
url: '../../static/home.json', //仅为示例,并非真实接口地址。
dataType:'json',
data:{},
success: function (res) {
this.goodsList = res.data.goods
console.log(this.goodsList);
}
});
},
onLoad(){
this.getList();
console.log(this.goodsList);
},
数据已获取到 为啥无法渲染页面上去

2019-06-12 17:47 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复