Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-admin
Commits
4d76881e
Commit
4d76881e
authored
Sep 13, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix: DynamicIcons组件修复
parent
ea53f786
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
index.tsx
src/components/DynamicIcons/index.tsx
+4
-5
No files found.
src/components/DynamicIcons/index.tsx
View file @
4d76881e
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment