Blame view

src/Icon/Icon.js 664 Bytes
3a3ecabe   Imshann   init
1
2
3
4
  import  * as iconsSvg from "@ant-design/icons-svg";
  import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpers";
  
  class Icon {
f886eef1   Imshann   优化Alert、Breadcrumb
5
      
dd962f77   Imshann   优化
6
7
      useModules = ["$compile"];
  
3a3ecabe   Imshann   init
8
      constructor() {
dd962f77   Imshann   优化
9
10
11
          let template = renderIconDefinitionToSVGElement(
              iconsSvg[$scope.type],
              {
3a3ecabe   Imshann   init
12
13
14
15
16
                  extraSVGAttrs: {
                      width: "1em",
                      height: "1em",
                      fill: "currentColor",
                  },
dd962f77   Imshann   优化
17
18
19
              }
          )
          $element.append(template);
3a3ecabe   Imshann   init
20
      }
f886eef1   Imshann   优化Alert、Breadcrumb
21
22
23
24
  
      render() {
          return `<span class="anticon"></span>`
      }
3a3ecabe   Imshann   init
25
  }
f886eef1   Imshann   优化Alert、Breadcrumb
26
27
28
29
  
  Icon.propTypes = {
      type: PropTypes.string,
  };