You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
316 B
TypeScript
12 lines
316 B
TypeScript
1 year ago
|
import React from 'react'
|
||
|
import * as icons from '@ant-design/icons'
|
||
|
// 自定义样式style
|
||
|
const Icon = (props: { icon: string, style?: object}) => {
|
||
|
const { icon, style } = props;
|
||
|
const antIcon: { [key: string]: any } = icons;
|
||
|
return React.createElement(antIcon[icon], { style });
|
||
|
|
||
|
};
|
||
|
|
||
|
export default Icon
|