import React, { memo, PropsWithChildren } from 'react'; import { Carousel } from 'zarm'; import styles from './index.less'; import { CarouselConfigType } from '../DynamicEngine/schema'; interface CarouselTypes extends CarouselConfigType { isTpl: boolean; } const XCarousel = memo((props: PropsWithChildren) => { const { direction, swipeable, autoPlay, isTpl, imgList, tplImg } = props; console.log(direction); const contentRender = () => { return imgList.map((item, i) => { return (
); }); }; return (
{isTpl ? (
) : ( { // console.log(`onChange: ${index}`); }} direction={direction} swipeable={swipeable} autoPlay={autoPlay} loop > {contentRender()} )}
); }); export default XCarousel;