# swiper

Start from base library version 1.0.0. Please remaining backward compatible.

Slider view container. Which can only be placed swiper-item Component, otherwise it results in undefined behavior.

attribute type Default value Required Introductions Minimum version
indicator-dots boolean false no Whether to display panel pointer 1.0.0
indicator-color color rgba(0, 0, 0, .3) no Indicating point color 1.1.0
indicator-active-color color #000000 no Currently selected pointer color 1.1.0
autoplay boolean false no Whether to switch automatically 1.0.0
current number 0 no The current slider index 1.0.0
interval number 5000 no Automatic switching time interval 1.0.0
duration number 500 no Slide animation length 1.0.0
circular boolean false no Whether or not to use the slip 1.0.0
vertical boolean false no Is the sliding direction longitudinal? 1.0.0
previous-margin string "0px" no Front margin, which can be used to expose a small part of the previous item, accepts px and rpx value 1.9.0
next-margin string "0px" no Back margin, which can be used to expose a small portion of the latter item, is acceptable px and rpx value 1.9.0
snap-to-edge boolean "false" no when swiper-item A number greater than or equal to 2, closed circular And turn it on previous-margin or next-margin You can specify whether this margin applies to the first and last elements 2.12.1
display-multiple-items number 1 no Number of sliders displayed simultaneously 1.9.0
easing-function string "default" no Designation swiper Toggle Slow Animation Type 2.6.5
bindchange eventhandle no current When it changes, it triggers change Event, event.detail = {current, source} 1.0.0
bindtransition eventhandle no swiper-item Is triggered when the location of transition Event, event.detail = {dx: dx, Two: two} 2.4.3
bindanimationfinish eventhandle no Triggers at the end of the animation animationfinish Event, event.detail Ditto 1.9.0

easing-function Legal value

value Introductions Minimum version
default Default retarding function
linear Linear animation
easeInCubic Slow Down Animation
easeOutCubic Slow Out Animation
easeInOutCubic Slow in and slow out animation

# changeevent source Return value

from 1.4.0 Start,changeIncreased incidents sourceField that represents the cause of the change, with possible values as follows

  1. autoplay AutoPlay causes swiper changes
  2. touch Swiper changes caused by user stroke
  3. Other reasons will be expressed as empty strings.

# Bug & Tip

  1. tip: If in bindchange In the event callback function of setData change current Value, it is possible to cause setData Is constantly called, so usually please change current Prevalue detection source Field to determine if it was caused by user touch.

# sample code

Preview with Developer Tool