import React, { memo } from 'react'; import { Carousel } from 'zarm'; import styles from './index.less'; import { ICarouselConfig } from './schema'; const XCarousel = memo((props: ICarouselConfig) => { const { direction, swipeable, autoPlay, isTpl, imgList, tplImg } = props; const contentRender = () => { return imgList.map((item, i) => { return (
0 ? item.imgUrl[0].url : ''} alt="" />
); }); }; return ( <> {isTpl ? (
) : (
{ // console.log(`onChange: ${index}`); }} direction={direction} swipeable={swipeable} autoPlay={autoPlay} loop > {contentRender()}
)} ); }); export default XCarousel;