纵享丝滑 做回自己
版本下载 "swiper": "^5.4.5",
"vue-awesome-swiper": "^3.1.3",
{不然嘎嘎错}
文件中
import "swiper/css/swiper.css";
import Swiper from "swiper";
效果展示

接下来直接cv即可
<div class="box">
<div class="swiper" id="certify" v-if="countryitems.length > 0">
<div class="swiper-container">
<div class="swiper-wrapper">
<div
class="swiper-slide"
v-for="(item,index) in countryitems"
:key="index">
<img :src="item.listImage" />
</div>
</div>
</div>
</div>
继续cv
import "swiper/css/swiper.css";
import Swiper from "swiper";
export default {
mounted () {
this.swiper = new Swiper(".swiper-container", {
autoplay: true,
slidesPerView: 1,
initialSlide: 1,
effect: "coverflow",
centeredSlides: true,
spaceBetween: "-54%",
pagination: {
el: ".swiper-pagination",
clickable: true,
},
coverflowEffect: {
rotate: 0,
stretch: 10,
depth: 100,
modifier: 5,
slideShadows: false,
},
observer: true,
observeParents: false,
onSlideChangeEnd: function (swiper) {
swiper.update();
mySwiper.startAutoplay();
mySwiper.reLoop();
},
});
},
data() {
return {
swiper:null,
countryitems:[
{listImage:"https://img0.baidu.com/it/u=2900833435,993445529&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500"},
{listImage:"https://img0.baidu.com/it/u=2900833435,993445529&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500"},
{listImage:"https://img0.baidu.com/it/u=2900833435,993445529&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500"},
{listImage:"https://img0.baidu.com/it/u=2900833435,993445529&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500"},
{listImage:"https://img0.baidu.com/it/u=2900833435,993445529&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500"}
]
}
},
};
最后一步cv结束
.swiperss {
height: 355px;
width: 100%;
margin: 50px auto;
border: 1px solid green;
}
.box {
margin: 0 auto ;
height: 340px;
width: 1200px;
.swiper {
margin: 20px;
height: 340px;
img {
width: 600px;
height: 340px;
}
}
.swiper-container {
width: 100%;
height: 340px;
}
.bird {
margin-top: 20px;
}
}