blockly > ISelectableToolboxItem

ISelectableToolboxItem 介面

可選取工具箱中項目的介面。

Signature:

export interface ISelectableToolboxItem extends IToolboxItem 

擴充: IToolboxItem

方法

方法 說明
getClickTarget() 取得可點擊的 HTML 元素。上層工具箱元素會獲得點擊。上層工具箱會為這個元素新增 ID,以便將 onClick 事件傳送至正確的 toolboxItem。
getContents() 取得工具箱項目的內容。這些項目要以飛出視窗顯示,
getName() 取得工具箱項目的名稱。用於發出事件。
onClick(_e) 於點選工具箱項目時處理。
setSelected(_isSelected) 將目前的工具箱項目設為已選取。