Icon.js
631 Bytes
import * as iconsSvg from "@ant-design/icons-svg";
import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpers";
class Icon {
useModules = ["$compile"];
template = `<span class="anticon"></span>`
props = {
type: String,
};
constructor() {
let template = renderIconDefinitionToSVGElement(
iconsSvg[$scope.type],
{
extraSVGAttrs: {
width: "1em",
height: "1em",
fill: "currentColor",
},
}
)
$element.append(template);
}
}