12 lines
316 B
TypeScript
12 lines
316 B
TypeScript
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
|