#
luxiaotao1123
2024-02-06 e9293e07cd386b1cdca525f7c80683f146caa96d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import * as AntdIcons from '@ant-design/icons';
import React from 'react';
 
const allIcons = AntdIcons;
 
export function getIcon(name) {
  const icon = allIcons[name];
  return icon || '';
}
 
export function createIcon(icon) {
  if (typeof icon === 'object') {
    return icon;
  }
  const ele = allIcons[icon];
  if (ele) {
    return React.createElement(allIcons[icon]);
  }
  return '';
}