当我们尝试在反应流畅的滑块中提供12张以上的图像时,这些图像将出现并立即消失。如何使用react-slick解决此一致性问题。我已经使用下面的链接来做到这一点。
https://github.com/akiran/react-slick
this.settings = {
dots: false,
infinite: false,
speed: 500,
slidesToShow: 5,
slidesToScroll: 4,
initialSlide: 0,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
dots: true
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
initialSlide: 2
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
}
<Grid item xs={11}>
<div className="padding-container">
<Slider {...this.settings}>
{this.props.children}
</Slider>
</div>
</Grid>