本文主要是介绍微信小程序--wx:for循环多个嵌套数组,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
读取数据,数组下有多个数组:
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>
这篇关于微信小程序--wx:for循环多个嵌套数组的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!