一维数组:
js代码
const i0b=url; const i1b=url; Page({ data: { temp_basketball:[\'demo-text-1\',\'demo-text-2\'], images_basketball:[i0b,i1b], } })
wxml代码
<view class="page-section page-section-spacing swiper"> <swiper indicator-dots="true" autoplay="false" interval="2000" duration="500"> <block wx:for="{{temp_basketball}}" wx:key="*this"> <swiper-item> <image style="width:100%;height:160px;" src="{{images_basketball}}"></image> </swiper-item> </block> </swiper> </view>
二维数组:
js代码
const i0b=url; const i1b=url; Page({ data: { basketball_list:[ {temp:[\'demo-text-1\',\'demo-text-2\']}, {images:[i0b,i1b]}, ], } })
wxml代码
<view class="page-section page-section-spacing swiper"> <swiper indicator-dots="true" autoplay="false" interval="2000" duration="500"> <block wx:for="{{basketball_list[0].temp}}" wx:key="*this"> <swiper-item> <image style="width:100%;height:160px;" src="{{basketball_list[1].images[index]}}"></image> </swiper-item> </block> </swiper> </view>
请发表评论