json數據:前端
[//library-6F
[//library-6F-601
[//id:1-1 ,8(Y/N),9(Y/N)……21(Y/N)
'Y','Y','Y','N','Y','N','N','Y','Y','Y','Y','Y','Y'
],
[
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'
],
[
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'
],
[
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'
],
[
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'
],
[
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'
],
]
],json
wxml:學習
<view class="flex-wrp">
<view class="td flex-item time" style="flex-direction:column;">
<block wx:for="{{timeId}}">
<view>{{item}}</view>
</block>
</view>
<block wx:for="{{seatId}}">//得益於從這裏得到的index
<view class="td flex-item" style="flex-direction:column;">{{item}}
<block wx:for="{{library[0][0][index]}}" wx:for-item="YN"> //index
<view>
<image src="../images/{{YN}}.png" style="width:20px;height:20px;"></image>
</view>
</block>
</view>
</block>
</view>flex
{{變量}}spa
我想要的效果,在變量中再套個變量{{library[ 0 ][ 0 ][ i ]}}。變量分別讀取 library[0][0][0], library[0][0][1], library[0][0][2], library[0][0][3],library[0][0][4], library[0][0][5]。xml
不知道如何把這個變量 i 放進去,最後發現本身要的變量能夠經過上面for循環{{seatId}}的index來得到。也算是解決這個問題的一個方向。it
多學習,多進步,共勉io
有想招應屆生前端的請聯繫我,努力,有興趣,願意學習呀ԅ(¯㉨¯ԅ)for循環
【表情】class