blockly > ComponentManager > getComponents
ComponentManager.getComponents() 方法
取得具有指定功能的所有元件。
Signature:
getComponents<T extends IComponent>(capability: string | Capability<T>, sorted: boolean): T[];
參數
參數 | 類型 | 說明 |
---|---|---|
能力 | 字串 | 功能<T> | 元件功能。 |
sorted | boolean | 是否要傳回依重量排序的清單。 |
傳回:
T[]
符合指定功能的元件。