import React, { useMemo } from 'react'; import '../g.scss'; function BorderImg(props: IBorderImg) { const { value='', imgList=[], change, wrapStyle = { padding: '6px 20px 6px 20px' } } = props; const Redio = useMemo(() => { return (
{Array.isArray(imgList) && imgList?.length > 0 && imgList.map((item) => { if (item?.type === 'large') { return (
{ change?.(item?.key); }} key={item?.key} > 图片损坏
); } else { return (
{ change?.(item?.key); }} > 图片损坏
); } })}
); }, [value, imgList]); return Redio; } export default BorderImg; export interface IBorderImg { value?: string; imgList: IImgList[]; change?: Function; wrapStyle?: React.CSSProperties; } export interface IImgList { key: string; type?: string; imgUrl?: string; }