blockly > utils > dom > createSvgElement
Funkcja utils.dom.createSvgElement()
Metoda pomocnicza do tworzenia elementów SVG.
Podpis:
export declare function createSvgElement<T extends SVGElement>(name: string | Svg<T>, attrs: {
[key: string]: string | number;
}, opt_parent?: Element | null): T;
Parametry
Parametr | Typ | Opis |
---|---|---|
nazwa | ciąg znaków | Svg<T> | Nazwa tagu elementu. |
attrs | { [key: string]: string | number; } | Słownik nazw i wartości atrybutów. |
opt_parent | Element | null | (Opcjonalnie) Opcjonalny element nadrzędny, w którym ma zostać dołączony element. |
Zwraca:
T
, jeśli nazwa jest ciągiem lub bardziej szczegółowym typem, jeśli należy do klasy Svg.