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

42次阅读

共计 397 个字符,预计需要花费 1 分钟才能阅读完成。

新版本设置 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>

正文完
 0