我遇到了 react-slick 的问题。我需要让它在移动设备上“滑动”。不幸的是swipeToSlide: true,
,我在文档中找到的似乎不起作用。
有什么解决办法吗?
这是我的设置代码示例:
const settings = {
dots: true,
arrows: false,
fade: true,
swipeToSlide: false,
infinite: false,
slidesToShow: 1,
slidesToScroll: 1,
adaptiveHeight: true,
speed: 200,
customPaging(i) {
return (
<button
className={`${questions[i].answer && 'active'}`}
type="button"
/>
);
},
responsive: [
{
breakpoint: theme.media.tablet,
settings: {
swipeToSlide: true
}
}
],
beforeChange: (previous, next) =>
this.setState({ oldSlide: previous, activeSlide: next }),
afterChange: previous => this.setState({ activeSlide2: previous })
};