blockly > ComponentManager > addCapability
Methode "ComponentManager.addCapability()"
Fügt einer vorhandenen registrierten Komponente eine Funktion hinzu.
Unterschrift:
addCapability<T>(id: string, capability: string | Capability<T>): void;
Parameter
Parameter |
Typ |
Beschreibung |
id |
String |
Die ID der Komponente, der die Funktion hinzugefügt werden soll. |
capability |
String | Funktion<T> |
Die hinzuzufügende Fähigkeit. |
Gibt zurück:
voidm
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2024-08-29 (UTC).
[null,null,["Zuletzt aktualisiert: 2024-08-29 (UTC)."],[[["The `ComponentManager.addCapability()` method allows adding a new capability to an existing registered component."],["It requires the component's ID and the capability (as a string or `Capability` object) as input."],["This method doesn't return any value and modifies the component directly."]]],["The `addCapability` method of `ComponentManager` adds a capability to an existing component. It takes two parameters: `id`, a string representing the component's ID, and `capability`, which can be either a string or a `Capability\u003cT\u003e` object. This method modifies the component to include the specified capability. The method doesn't return any value.\n"]]