欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序 <swiper-item>標(biāo)簽傳入數(shù)據(jù)

 更新時間:2017年05月08日 15:39:15   投稿:lqh  
這篇文章主要介紹了微信小程序 <swiper-item>標(biāo)簽傳入數(shù)據(jù)的相關(guān)資料,需要的朋友可以參考下

微信小程序 <swiper-item>標(biāo)簽傳入數(shù)據(jù)

在<swiper-item>中用for循環(huán)傳入多個成對不同數(shù)據(jù)時的實現(xiàn)方法。

看下效果圖:

遍歷實現(xiàn)方法:wxss省略:

wxml中代碼:

<!--導(dǎo)航部分輪播圖-->
<swiper class="navban" indicator-dots="{{indicatorDots}}" interval="{{interval}}" duration="{{duration}}">
    <swiper-item>
      <block wx:for="{{navs}}">
        <view class="navbox">
          <image class="navimg" src="{{item.navimg}}"></image>
          <text class="navtext">{{item.navtext}}</text>
        </view>
       </block>
    </swiper-item>  
</swiper>

相對應(yīng)js里面的代碼:

var app = getApp()
Page({
 data: {
  navs:[
   { navimg:'/images/i01.png', navtext:'掌上信息'},
   { navimg:'/images/i02.png', navtext:'商家'},
   { navimg:'/images/i03.png', navtext:'搶購'},
   { navimg:'/images/i04.png', navtext:'搶福利'},
   { navimg:'/images/i05.png', navtext:'五折卡'},
   { navimg:'/images/i06.png', navtext:'黑貓活動'},
   { navimg:'/images/i07.png', navtext:'本地圈'},
   { navimg:'/images/i08.png', navtext:'順風(fēng)車'},
  ],
  indicatorDots: true,
  autoplay: true,
  interval: 2000,
  duration: 1000,
 }
 
})

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

相關(guān)文章

最新評論