From c7c3df90cbb184970e5e2e3ee75460ac40de6e47 Mon Sep 17 00:00:00 2001 From: lingting Date: Wed, 20 Oct 2021 19:42:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(Icon):=20=E4=BF=AE=E5=A4=8Dtype=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=97=B6,=20Icon=E5=B1=95=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Icon/Icon.tsx | 6 ++++++ 1 file changed, 6 insertions(+) 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 ? (