a=['ab','cd','ef','gh']
b=['ij','kc','wb','wh']
使用两个数组同时进行列表渲染,每个循环从两个数组中同索引的位置分别取值
希望最后的效果是这样:
<view> <view>'ab'</view> <view>'ij'</view> </view> <view> <view>'cd'</view> <view>'kc'</view> </view> <view> <view>'ef'</view> <view>'wb'</view> </view> <view> <view>'gh'</view> <view>'wh'</view> </view>
<view wx:for="{{a}}" wx:key="index"> <view>{{item}}</view> <view>{{b[index]}}</view> </view>
<view wx:for='{{a}}' wx:key='index'> <text>{{item}}</text> <text>{{b[index]}}</text> </view>