1

当我们尝试在 react-slick 滑块中提供超过 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>
4

0 回答 0