2
3
4 
5 
6
7
8
复制代码
data数据
复制代码
data(){
return{
swipersuccess:{
effect:"coverflow",
grabCursor: true,
watchSlidesProgress: true,
centeredSlides: true,
loop: true,
loopedSlides: 3,
slidesPerView: 3,
autoplay: {
delay: 3000,//自动播放速度
disableOnInteraction: false//鼠标移上去时是否还继续播放
},
coverflowEffect: {
// rotate: 50,
// stretch: 0,
// depth: 500,
// modifier: 1,
// slideShadows : true
rotate: 30,
stretch: 0,
depth: 60,
modifier: 6,
slideShadows : false
},
},
}
}
复制代码
生命周期
复制代码
computed: {
swiper() {
return this.$refs.mySwiper.swiper;
}
},
复制代码
css(根据业务需求自行改动)
复制代码
.successNav .swiper-slide.swiper-slide-active img {
transform: scaleX(1.6);
border-radius: 5px;
}
.successNav .swiper-slide.swiper-slide-duplicate-prev img,
.successNav .swiper-slide.swiper-slide-next img,
.successNav .swiper-container-3d .swiper-slide-shadow-right,
.successNav .swiper-container-3d .swiper-slide-shadow-left,
.successNav .swiper-slide.swiper-slide-prev img,
.successNav .swiper-slide.swiper-slide-prev{
border-radius: 5px !important;
}
复制代码
如果不是使用vue的小伙伴也别着急,还是有案例可以直接用js+html的
这里好像插入不了压缩包诶,有需要的小伙伴可以留邮箱发哈,有swiper4和swiper3两个版本的html+js的写法。和前面适用vue的一样,能自动滚,也能手机触摸手滑滚动https://www.cnblogs.com/web1/p/9758534.html


