vue-awesome-swiper 使用
安装 vue swipernpm install swiper@6.7.1 --savenpm install vue-awesome-swiper --save<div class="swiper-container filmswiper"><div class="swiper-wrapper"><div class="swiper-slide"><im
·
安装 vue swiper
npm install swiper@6.7.1 --save
npm install vue-awesome-swiper --save
<div class="swiper-container filmswiper">
<div class="swiper-wrapper">
<div class="swiper-slide">
<img src="" alt=""/>
</div>
<div class="swiper-slide">
<img src="" alt=""/>
</div>
<div class="swiper-slide">
<img src="" alt=""/>
</div>
</div>
</div>
在vue 引入文件中 swiper
import { Swiper, SwiperSlide } from "swiper";
import "swiper/swiper-bundle.css";
export default {
components: {
Swiper,
SwiperSlide,
},
mounted(){
const swiper = new Swiper(".filmswiper",{
loop: true,
autoplay: {
delay: 3000,
disableOnInteraction: false,
},
})
}
}
更多推荐
已为社区贡献7条内容
所有评论(0)