swiper在vue项目中不能够自动轮播

下载

npm install swiper vue-awesome-swiper --save
 "swiper": "^6.2.0",
 "vue-awesome-swiper": "^4.1.1",

局部引入swiper,自动轮播需要引入插件,相关网站

import SwiperCore, { Autoplay } from 'swiper';
SwiperCore.use([Autoplay]);

import { Swiper, SwiperSlide} from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css'
swiperOption: {
        loop: true,
        autoplay: {
          delay: 2000, 
          disableOnInteraction: false
         },
      },

 

 

 

 

 

 

Logo

前往低代码交流专区

更多推荐