컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
차단 > 차단 > getIcon
Block.getIcon() 메서드
서명:
getIcon<T extends IIcon>(type: IconType<T> | string): T | undefined;
매개변수
매개변수 |
유형 |
설명 |
유형 |
IconType<T> | 문자열 |
검색할 아이콘의 유형입니다. typescript를 사용할 때 올바른 유형 확인을 위해 IconType 를 전달하는 것이 좋습니다. |
반환:
목 | 정의되지 않음
블록에 있는 경우 지정된 유형의 아이콘이며 그렇지 않으면 정의되지 않습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 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,[]]