数组循环嵌套就是无法获取到数据?求大神

发布于 8 年前作者 liuping842 次浏览最后编辑 8 年前来自 issues

这是返回的数据想获取goods里面的数据

<view wx:for="{{orderlist}}" wx:for-index="lessonNum" wx:key="index">
   <view wx:for="{{item.goods}}" wx:for-item="cell" wx:for-index="lessonNum" wx:key="index">
    {{cell.name}}
    {{cell.price}}
  </view>
</view>

不明白为什么就是获取不到goods数组里的数据

1 回复
zhuwei
zhuwei1 楼6 年前

item.goods不是数组,是json对象

<view wx:for="{{orderlist}}" wx:for-index="lessonNum" wx:key="index">
   <view>
    {{item.goods.name}}
    {{item.goods.price}}
  </view>
</view>