קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
blockly > חסימה > getIcon
שיטת Block.getIcon()
Signature:
getIcon<T extends IIcon>(type: IconType<T> | string): T | undefined;
פרמטרים
פרמטר |
סוג |
תיאור |
סוג |
IconType<T> | String (מחרוזת) |
סוג הסמל שצריך לאחזר. כדאי להעביר IconType כדי לבצע בדיקת סוג תקינה כשמשתמשים ב-typescript. |
החזרות:
T | לא מוגדר
הסמל עם הסוג הנתון, אם הוא קיים בבלוק, לא מוגדר אחרת.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[],["The `Block.getIcon()` method retrieves an icon associated with a block. It accepts a parameter `type`, which specifies the icon type, preferably as an `IconType` for TypeScript type checking, or as a string. The method returns the icon of the specified type if it exists on the block, otherwise, it returns undefined. This allows users to access a specific icon from a Block by providing its corresponding type.\n"],null,[]]