日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢(xún)
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
創(chuàng)新互聯(lián)百度小程序教程:swiper 滑塊視圖容器
  • swiper 滑塊視圖容器
    • 屬性說(shuō)明
      • change 事件 source 返回值
    • 示例
      • 代碼示例 1:
      • 代碼示例 2:自定義底部切換圓點(diǎn)
      • 代碼示例 3:模擬 tabs 組件功能
    • Bug & Tip
    • 常見(jiàn)問(wèn)題
      • Q:swiper 的面板指示點(diǎn)能自定義樣式嗎?

    swiper 滑塊視圖容器

    解釋:滑塊視圖容器。內(nèi)部只允許使用 swiper-item 組件描述滑塊內(nèi)容,否則會(huì)導(dǎo)致未定義的行為。

    創(chuàng)新互聯(lián)公司從2013年開(kāi)始,先為上蔡等服務(wù)建站,上蔡等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢(xún)服務(wù)。為上蔡企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問(wèn)題。

    屬性說(shuō)明

    indicator-dots

    Boolean

    false

    是否顯示面板指示點(diǎn)

    indicator-color

    Color

    rgba(0, 0, 0, .3)

    指示點(diǎn)顏色

    indicator-active-color

    Color

    #333

    當(dāng)前選中的指示點(diǎn)顏色

    autoplay

    Boolean

    false

    是否自動(dòng)切換

    current

    Number

    0

    當(dāng)前所在頁(yè)面的 index

    current-item-id

    String

    當(dāng)前所在滑塊的 item-id ,不能與 current 被同時(shí)指定

    1.11
    低版本請(qǐng)做兼容性處理

    interval

    Number

    5000

    自動(dòng)切換時(shí)間間隔(單位:ms)

    duration

    Number

    500

    滑動(dòng)動(dòng)畫(huà)時(shí)長(zhǎng)(單位:ms)

    circular

    Boolean

    false

    是否采用銜接滑動(dòng)

    vertical

    Boolean

    false

    滑動(dòng)方向是否為縱向

    previous-margin

    String

    “0px”

    前邊距,可用于露出前一項(xiàng)的一小部分,支持 px 和 rpx

    1.11
    低版本請(qǐng)做兼容性處理

    next-margin

    String

    “0px”

    后邊距,可用于露出后一項(xiàng)的一小部分,支持 px 和 rpx

    1.11
    低版本請(qǐng)做兼容性處理

    display-multiple-items

    Number

    1

    同時(shí)顯示的滑塊數(shù)量

    1.11
    低版本請(qǐng)做兼容性處理

    bindchange

    EventHandle

    current 改變時(shí)會(huì)觸發(fā) change 事件,event.detail = {current: current, source: source}

    bindanimationfinish

    EventHandle

    動(dòng)畫(huà)結(jié)束時(shí)會(huì)觸發(fā) animationfinish 事件,event.detail 同上

    1.11
    低版本請(qǐng)做兼容性處理

    屬性名類(lèi)型默認(rèn)值必填說(shuō)明最低版本
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    change 事件 source 返回值

    change 事件中的 source 字段,表示觸發(fā) change 事件的原因,可能值如下:

    autoplay

    自動(dòng)播放導(dǎo)致的 swiper 切換

    touch

    用戶(hù)滑動(dòng)導(dǎo)致的 swiper 切換

    “”

    其他原因?qū)⒎祷乜兆址?/p>

    說(shuō)明

    示例

    跳轉(zhuǎn)編輯工具

    在開(kāi)發(fā)者工具中打開(kāi)

    在 WEB IDE 中打開(kāi)

    掃碼體驗(yàn)

    代碼示例

    請(qǐng)使用百度APP掃碼

    代碼示例 1:

    • SWAN
    • JS
    • CSS
     
     
     
    1. class="swiper"
    2. indicator-dots="{{switchIndicateStatus}}"
    3. indicator-color="rgba(0,0,0,0.30)"
    4. indicator-active-color="#fff"
    5. autoplay="{{switchAutoPlayStatus}}"
    6. current="0"
    7. current-item-id="0"
    8. interval="{{autoPlayInterval}}"
    9. duration="{{switchDuration}}"
    10. circular="true"
    11. vertical="{{switchVerticalStatus}}"
    12. previous-margin="0px"
    13. next-margin="0px"
    14. display-multiple-items="1"
    15. bind:change="swiperChange"
    16. bind:animationfinish="animationfinish">
    17. s-for="item in swiperList"
    18. item-id="{{itemId}}"
    19. class="{{item.className}}">
    20. {{item.value}}
    21. 指示點(diǎn)
    22. class="init-switch"
    23. checked="{{switchIndicateStatus}}"
    24. bind:change="switchIndicate">
    25. 自動(dòng)切換
    26. checked="{{switchAutoPlayStatus}}"
    27. bind:change="switchAutoPlay"
    28. class="init-switch">
    29. 縱向滑動(dòng)
    30. checked="{{switchVerticalStatus}}"
    31. bind:change="switchVertical"
    32. class="init-switch">
    33. 滑塊切換時(shí)長(zhǎng)
    34. {{switchDuration}}ms
    35. class="slider"
    36. min="300"
    37. max="1500"
    38. value="{{switchDuration}}"
    39. bind:change="changeSwitchDuration">
    40. 自動(dòng)切換時(shí)間間隔
    41. {{autoPlayInterval}}ms
    42. class="slider"
    43. min="1000"
    44. max="5000"
    45. value="{{autoPlayInterval}}"
    46. bind:change="changeAutoPlayInterval">

    設(shè)計(jì)指南

    建議滑塊視圖數(shù)量控制在 2-5 個(gè)。
    建議滑塊切換時(shí)長(zhǎng)不低于 500ms ,自動(dòng)切換時(shí)間間隔不高于 5000ms 。

    代碼示例 2:自定義底部切換圓點(diǎn)

    • SWAN
    • JS
    • CSS
     
     
     
    1. 自定義底部切換圓點(diǎn)
    2. class="swiper-custom"
    3. autoplay="auto"
    4. interval="3000"
    5. duration="500"
    6. current="{{swiperCurrent}}"
    7. bindchange="swiperChangeCustom">

    代碼示例 3:模擬 tabs 組件功能

    • SWAN
    • JS
    • CSS
     
     
     
    1. 模擬 tabs 組件功能
    2. 全部
    3. 服務(wù)通知
    4. 系統(tǒng)通知
    5. 評(píng)論
    6. 其他
    7. 我是全部
    8. 我是服務(wù)通知
    9. 我是系統(tǒng)通知
    10. 我是評(píng)論
    11. 我是其他

    Bug & Tip

    • Tip:如果在 bindchange 的事件回調(diào)函數(shù)中使用 setData 改變 current 值,則會(huì)導(dǎo)致 setData 被重復(fù)調(diào)用,因而通常情況下請(qǐng)?jiān)诟淖?current 值前檢測(cè) source 字段來(lái)判斷是否是由于用戶(hù)觸摸引起的。
    • Tip:組件內(nèi)部只可放置 swiper-item 組件,否則會(huì)導(dǎo)致未定義的行為。

    常見(jiàn)問(wèn)題

    Q:swiper 的面板指示點(diǎn)能自定義樣式嗎?

    A:參見(jiàn)屬性說(shuō)明,可以去掉 dot 顯示之后,自己定義 dot 樣式。具體代碼可參見(jiàn)上方代碼示例 2 。


    當(dāng)前題目:創(chuàng)新互聯(lián)百度小程序教程:swiper 滑塊視圖容器
    網(wǎng)頁(yè)網(wǎng)址:http://www.5511xx.com/article/cocsigo.html