import React, { memo } from 'react'; import * as Icon from '@ant-design/icons'; import IconImg from '../../../../assets/icon.png'; import { AntdIconProps } from '@ant-design/icons/lib/components/AntdIcon'; import { AntdIconType } from './icon'; import { IIconConfig } from './schema'; interface IconType extends IIconConfig { isTpl?: boolean; } const XIcon = memo((props: IconType) => { const { color, size, type, spin, isTpl } = props; const MyIcon: React.ForwardRefExoticComponent & React.RefAttributes> = Icon[type]; return isTpl ? (
{type} 图标
) : ( ); }); export default XIcon;