Commit 4d76881e authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🐞 fix: DynamicIcons组件修复

parent ea53f786
......@@ -2,11 +2,11 @@ import React from 'react';
import * as icons from '@ant-design/icons';
/**
* 主要用于动态导入阿里的图标iconfont
* @param props
* @param props
*/
const DynamicIcon: React.FC<{type: React.ReactNode}> = (props) => {
const DynamicIcon: React.FC<{ type: React.ReactNode }> = (props) => {
const Icons = icons[props.type as string]
return props.type ? <Icons/> : null
return (props.type && Icons) ? <Icons /> : null
}
export default DynamicIcon
\ No newline at end of file
export default DynamicIcon
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment