读取数据,数组下有多个数组:

wxml页面上显示:

wx:for="{{photo}}" wx:for-item="dayItem" wx:key="{{dayItem.id}}"wx:for="{{dayItem.color}}" wx:key="{{item.colorId}}"

 例子:

 view class="scroll_box" wx:for="{{photo}}" wx:for-item="dayItem" wx:key="{{dayItem.id}}"    view class='main'      view class='title'{{dayItem.chineseName}}        text class='subTitle'{{dayItem.englishName}}/text      /view        view class='more'查看更多          image src="image/more.png" mode="widthFix"/image        /view    /view      view class="item_list" wx:for="{{dayItem.color}}" wx:key="{{item.colorId}}"          image src="{{item.image}}" class="item_book_img" mode="widthFix"/image          view class='title'{{item.title}}/view      /view  /view

 

TAG标签: 微信小程序for循环遍历数组

http://www.xiaochengxub.com/read-105570.html