在引入插件的时候无论如何也不生效,后来发现
2.添加HTML内容。Swiper7的默认容器是'.swiper',Swiper6之前是'.swiper-container'。
<div class="swiper"> <div class="swiper-wrapper"> <div class="swiper-slide">Slide 1</div> <div class="swiper-slide">Slide 2</div> <div class="swiper-slide">Slide 3</div> </div> <!-- 如果需要分页器 --> <div class="swiper-pagination"></div> <!-- 如果需要导航按钮 --> <div class="swiper-button-prev"></div> <div class="swiper-button-next"></div> <!-- 如果需要滚动条 --> <div class="swiper-scrollbar"></div> </div>
改下容器名字即可
如果不行 俩都加上
标签:容器,插件,vue,轮播,Slide,swiper From: https://www.cnblogs.com/xiaobaizitaibai/p/16944660.html