今天公司的轮播图改成了一张图片,说是不让轮播,我看在手机端用的是reactjs-swiper,但是一张图片也会轮播,所以,经过查看官网,看到啦有option这个属性,可以将swiper的属性设置到这里,设置为不轮播,就可以
const swiperOptions = {
// preloadImages: true,
// autoplay: 4000,
// autoplayDisableOnInteraction: false,
noSwiping: true
};
const buildHtml = () => {
const html = data.length > 0 ?
<ReactSwiper
className="swipe swiper-no-swiping"
swiperOptions={swiperOptions}
items={ data }
options = {{noSwiping: true}}
/> : '';
return html;
};