blockly > ContextMenuRegistry > getContextMenuOptions

ContextMenuRegistry.getContextMenuOptions() 方法

取得指定範圍的有效內容選單選項。只有在 preconditionFn 顯示不應隱藏選項時,才會納入選項。

Signature:

getContextMenuOptions(scope: Scope, menuOpenEvent: Event): ContextMenuOption[];

參數

參數 類型 說明
範圍 範圍 目前的內容選單範圍 (即所點選的工作區或區塊)。
menuOpenEvent 活動 導致選單開啟的事件。

退貨:

ContextMenuOption[]

ContextMenuOptions 清單