乐趣区

关于swiper.js:swiper720设置autoplay自动播放不生效

新版本设置 autoplay 怎么都不失效,看了官网的 Demos 才发现须要在 SwiperCore 上应用 Autoplay 组件,包含鼠标滚动这些都须要 use 对应的组件

<script>
import SwiperCore, {Autoplay, FreeMode, Scrollbar, Mousewheel} from "swiper";
SwiperCore.use([Autoplay, FreeMode, Scrollbar, Mousewheel]);
</script>

<template>
  <swiper
    :direction="'vertical'"
    :spaceBetween="50"
    :scrollbar="true"
    :mousewheel="true"
    :autoplay="{
      delay: 1500,
      disableOnInteraction: false,
    }"class="mySwiper"
  />
</template>
退出移动版