<Carousel
additionalTransfrom={0}
autoPlaySpeed={3000}
centerMode={false}
className=""
containerClass="container"
dotListClass=""
draggable
focusOnSelect={false}
infinite
itemClass={styles['slider-item']}
keyBoardControl
minimumTouchDrag={80}
partialVisible
renderButtonGroupOutside
renderDotsOutside={false}
responsive={{
desktop: {
breakpoint: {
max: 3000,
min: 1024,
},
items: 3,
partialVisibilityGutter: 40,
},
mobile: {
breakpoint: {
max: 464,
min: 0,
},
items: 1,
partialVisibilityGutter: 30,
},
tablet: {
breakpoint: {
max: 1024,
min: 464,
},
items: 2,
partialVisibilityGutter: 30,
},
}}
showDots={false}
arrows={false}
sliderClass=""
slidesToSlide={1}
swipeable
customButtonGroup={
<CustomButtonGroupAsArrows
title={title}
seeAllCount={seeAllCount}
seeAllLink={seeAllLink}
/>
}
>
{items.map((item, i) => (
<SliderItemWrapper key={i}>{item}</SliderItemWrapper>
))}
</Carousel>
SliderItemWrapper 是简单的 div。
我猜问题可能出在totalItems
属性里面carouselState
,因为它会随机计算子项计数。我尝试了不同的配置,但所有配置都面临相同的问题。