ObjectnullSlider configuration
{
currentPage: 0,
thresholdDistance: 500,
thresholdTime: 100,
autoplay:1000,
loop:true,
direction:'vertical',
loopedSlides:1,
slidesToScroll:1
}
stringslideSwitching effect,it Could be slide, fade, coverflow, nest
{
effect:'slide'
}
stringhorizontalDirection setting,it Could be horizontal or vertical (for vertical slider)
{
direction:'horizontal'
}
number0Initing current Page of slider
{
currentPage:0
}
number100Minimal distance (in px) to trigger swipe to next/previous slide during swipes
{
thresholdDistance:'100'
}
number500Minimal speed (in ms) to trigger swipe to next/previous slide during swipes
{
thresholdTime:'500'
}
numbernumber[ms]delay between transitions (in ms).
{
autoplay:'1000'
}
booleanfalseSet to true to enable continuous loop mode
{
loop:false
}
number1like carousel, works with multiple slides
{
loopedSlides:1
}
number1slides scrolled at once
{
slidesToScroll:1
}
booleanfalseWhen the touch event is triggered, the entire page scrolls
{
preventDocumentMove:true
}
number[ms]300Sliding speed[ms]
{
speed: 300
}
stringeaseSliding mode
{
timingFunction: 'ease'
}
booleantrueWhether paging is displayed in all modes
{
pagination: true
}
functionnullcreateElement, indexCustom paging function, the parameter is VUE's createElement function, and the current page number index
{
renderPagination: (h, index) => {
return h('div', {
class: 'swiper-pagination-bullet'
}, [index])
}
}
booleanfalseWhether to slide in the middle
{
centeredSlides: true
}
booleanfalseUse itemAnimation in infinite scrolling to ensure that the last one to the first (first to last) effect ends before you can continue to slide
{
itemAnimation: true
}
booleanfalsePrevent Slider sliding
{
freeze: false
}
booleanfalseStop rebound
{
preventRebound: false
}
string0.8Coverflow mode configuration width scale scaling, range 0~1
{
widthScalingRatio: '0.8'
}
string0.8Coverflow mode configuration hight scale scaling, range 0~1
{
heightScalingRatio: '0.8'
}
string200Configuration of sliding item offset in coverflow mode
{
deviation: '200'
}
booleantrueWhen nesting the same direction of the swiper, when the child swiper is switched, the parent swiper will switch.
{
nested: false
}
numberSliding to (number) page
slideTo () {
this.$refs.slider.$emit('slideTo', num)
}
nullSliding to the next page
slideNext () {
this.$refs.slider.$emit('slideNext')
}
nullSliding to the previous page
slide () {
this.$refs.slider.$emit('slidePre')
}
msOpening timing carousel,Setting the carousel time
this.$refs.slider.$emit('autoplayStart',1000)
Pause timing carousel
this.$refs.slider.$emit('autoplayStop')
objThe current sliding to page number, the parameter is slider basic information
slide (data) {
console.log(data)
}
objinitted slider , and the parameters are slider basic information
init (data) {
console.log(data)
}
objtapped on page , and the parameters are slider basic information
tap (data) {
console.log(data)
}