這個是數(shù)組為0是,初始化的swiper 對后續(xù)的swiper有影響了,加個 長度不等于零的判斷
{
props.model.length>0 ? <Swiper
className='test-h'
indicatorColor='#5F7C99'
indicatorActiveColor='#297AF8'
vertical={false}
circular
style={{ height: `${props.height}px` }}
indicatorDots
autoplay>
{
props.model.map((item, index) => {
return <SwiperItem key={index}>
<Image src={item} className="img"></Image>
</SwiperItem>
})
}
</Swiper> : null
}