blockly > utils > dom > createSvgElement
utils.dom.createSvgElement() işlevi
SVG öğeleri oluşturmak için yardımcı yöntem.
İmza:
export declare function createSvgElement<T extends SVGElement>(name: string | Svg<T>, attrs: {
[key: string]: string | number;
}, opt_parent?: Element | null): T;
Parametreler
Parametre |
Tür |
Açıklama |
ad |
dize | Svg<T> |
Öğenin etiket adı. |
attrs |
{ [key: string]: string | sayı; } |
Özellik adlarının ve değerlerinin sözlüğü. |
opt_parent |
Öğe | boş |
(İsteğe bağlı) Öğenin ekleneceği isteğe bağlı üst öğe. |
Şunu döndürür:
S
name bir dizeyse veya Svg üyesiyse daha spesifik bir türse.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2024-08-22 UTC.
[null,null,["Son güncelleme tarihi: 2024-08-22 UTC."],[[["Creates SVG elements with specified attributes and optional parent element."],["Accepts element tag name, attribute dictionary, and optional parent element as parameters."],["Returns the created SVG element, with typing based on the provided tag name."],["Simplifies SVG element creation within Blockly projects."]]],["The `createSvgElement` function creates SVG elements. It accepts the element's tag name (`name`) as either a string or a member of the `Svg` type, along with a dictionary of attributes (`attrs`) as key-value pairs (string or number). An optional parent element (`opt_parent`) can be provided to which the created element will be appended. The function returns the created SVG element, with a specific type if given a `Svg` member.\n"]]