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

微信小程序 開(kāi)發(fā)之滑塊視圖容器(swiper)詳解及實(shí)例代碼

 更新時(shí)間:2017年02月22日 10:13:53   作者:何東_hd  
這篇文章主要介紹了微信小程序 開(kāi)發(fā)之滑塊視圖容器(swiper)詳解及實(shí)例代碼的相關(guān)資料,需要的朋友可以參考下

微信小程序 開(kāi)發(fā)之滑塊視圖容器詳解

實(shí)現(xiàn)效果圖:

這里寫(xiě)圖片描述

實(shí)現(xiàn)起來(lái)特別簡(jiǎn)單,看看代碼是怎么寫(xiě)的呢:

<swiper class="swiper" indicator-dots="{{indcatorDots}}" autoplay="{{autoPlay}}" interval="{{interval}}" duration="{{duration}}">
 <block wx:for="{{imgUrls}}" wx:for-index="index">
  <swiper-item>
   <image src="{{item}}" class="side-img"></image>
  </swiper-item>
 </block>
</swiper>

這就是布局了,看一下js里面代碼:

Page({
  data: {
    imgUrls: [
      'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
      'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
      'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'],
    indcatorDots: true,
    autoPlay: true,
    interval: 5000,
    duration: 500
  },

,swiper有以下一些常用屬性:

這里寫(xiě)圖片描述

標(biāo)記的兩個(gè)屬性暫時(shí)不管。

注意:其中只可放置組件,否則會(huì)導(dǎo)致未定義的行為。

swiper-item

僅可放置在組件中,寬高自動(dòng)設(shè)置為100%。

就是這樣,自己動(dòng)手試試。

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

相關(guān)文章

最新評(píng)論