Swiper.js断点自动播放问题

Swiper.js breakpoints autoplay issue

我正在设置 swiper.js 库 (http://idangero.us/swiper/),我遇到了设置问题。我尝试设置滑动器以在桌面尺寸上开始自动播放并在移动设备上停止自动播放(例如 768px 向下)。在桌面上一切正常,即使您尝试在不刷新页面的情况下进行响应也是如此。页面刷新后移动尺寸开始出现问题。 Swiper 忽略所有设置,直到页面调整大小。

演示:https://codepen.io/anon/pen/WWdera

var swiper = new Swiper('.swiper-container', {
      autoplay: {
          delay: 1000
        },
      breakpoints: {
        768: {
          autoplay: {
            delay: false
          }
        }
      },
      pagination: {
        el: '.swiper-pagination',
        clickable: true,
      },
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      },
    });

有人知道我做错了什么吗?谢谢

这在重启后有效。您需要将自动播放对象更改为 boolean

var swiper = new Swiper('.swiper-container', {
  autoplay: {
      delay: 1000
    },
  breakpoints: {
    768: {
      autoplay: false
    }
  },
  pagination: {
    el: '.swiper-pagination',
    clickable: true,
  },
  navigation: {
    nextEl: '.swiper-button-next',
    prevEl: '.swiper-button-prev',
  },
});