Blame view

src/Icon/Icon.js 516 Bytes
3a3ecabe   Imshann   init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  import  * as iconsSvg from "@ant-design/icons-svg";
  import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpers";
  
  class Icon {
      props = {
          type: String,
      };
  
      constructor() {
          $element.replaceWith(
              renderIconDefinitionToSVGElement(iconsSvg[this.props.type], {
                  extraSVGAttrs: {
                      width: "1em",
                      height: "1em",
                      fill: "currentColor",
                  },
              })
          );
      }
  }