import { CarouselConfigType } from '@/components/DynamicEngine/schema'; import React, { memo, PropsWithChildren } from 'react'; import { Carousel } from 'zarm'; import styles from './index.less'; interface CarouselTypes extends CarouselConfigType { isTpl: boolean; } const XCarousel = memo((props: PropsWithChildren) => { 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;