h5页面中有定时器的时候,轮播图不滚动

(1)轮播图 react-slick 的使用,但是页面中有其他定时器的时候,轮播图不滚动
npm install react-slick

import Carousel from "react-slick";

const settings = { 
speed: 200, 
autoplay: true,
 dots: false, 
infinite: true, 
slidesToShow: 1,   //一页展示几条数据
 slidesToScroll: 1,
 vertical: true, 
verticalSwiping: true,
 arrows: false }

 
{this.state.users && {this.state.users.map((item,index) => { return(
{item.phone} {item.content} {item.amountYuan}
{index < this.state.users.length -1 &&
}
) })} }

(2)想要轮播滚动,要用 antd-mobile

npm install antd-mobile

import { Carousel } from 'antd-mobile';
import 'antd-mobile/dist/antd-mobile.css';
const settings = {
         speed: 100,
         autoplay: true,
         dots: false,
         infinite: true,
         slidesToShow: 3,
         slidesToScroll: 1,
         vertical: true,
         verticalSwiping: true,
         arrows:false,
     }

{firstBannerList&&firstBannerList.length>0? {firstBannerList.map((item,index) => { return(

{item.itemName}

{item.targetPageUrl}

{item.targetPageTitle}

) })}
:null }
const styles = { scrollTextdiv: { display: 'flex', height: 34, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', width: '100%', paddingTop:10 // overflow: 'hidden' }, }

你可能感兴趣的:(h5页面中有定时器的时候,轮播图不滚动)