Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
blockly > ComponentManager > getComponents
Metoda KomponentManager.getKomponents()
Pobiera wszystkie komponenty o określonej możliwości.
Podpis:
getComponents<T extends IComponent>(capability: string | Capability<T>, sorted: boolean): T[];
Parametry
Parametr |
Typ |
Opis |
zdolność |
ciąg znaków | Funkcja<T> |
Możliwości komponentu. |
posortowane |
wartość logiczna |
Określa, czy zwrócić listę uporządkowaną według wagi. |
Zwroty:
K[]
Komponenty pasujące do określonej możliwości.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-08-29 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2024-08-29 UTC."],[[["The `getComponents` method retrieves all components possessing a given capability."],["It accepts the capability (as a string or `Capability` object) and a boolean indicating whether to sort results by weight."],["The method returns an array of components matching the specified capability."]]],["The `getComponents` method retrieves components possessing a specific capability, defined by either a string or a `Capability\u003cT\u003e` object. It accepts an optional boolean parameter, `sorted`, to determine if the returned list should be ordered by component weights. The method returns an array (`T[]`) of components that match the provided capability. The method's core function is to filter and return relevant components based on a specified capability, with an option for sorted results.\n"]]