diff --git a/src/components/Icon/Icon.tsx b/src/components/Icon/Icon.tsx index 47fddd4..77cbe01 100644 --- a/src/components/Icon/Icon.tsx +++ b/src/components/Icon/Icon.tsx @@ -15,6 +15,12 @@ const converTypeToIconPath = (type: string) => { const Icon: React.FC = (props: IconProps) => { const { type } = props; + + // type 值异常 + if (!type || type.length === 0) { + return <>; + } + const IconType = allIcon[converTypeToIconPath(type)]; return IconType ? (