סקר מחקר: נשמח לשמוע על החוויה שלך עם Blockly
לפתיחת הסקר
blockly > utils > dom > createSvgElement
הפונקציה utils.dom.createSvgElement()
שיטה מסייעת ליצירת רכיבי SVG.
Signature:
export declare function createSvgElement<T extends SVGElement>(name: string | Svg<T>, attrs: {
[key: string]: string | number;
}, opt_parent?: Element | null): T;
פרמטרים
פרמטר |
סוג |
תיאור |
שם |
מחרוזת | Svg<T> |
שם התג של הרכיב. |
attrs |
{ [key: string]: string | מספר; } |
מילון של שמות מאפיינים וערכים. |
opt_parent |
רכיב | null |
(אופציונלי) הורה אופציונלי שאליו צריך לצרף את הרכיב. |
החזרות:
T
אם השם הוא מחרוזת או סוג ספציפי יותר, אם הוא חבר ב-Svg.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-08-22 (שעון UTC).
[null,null,["עדכון אחרון: 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"]]