blockly > ComponentManager > getComponents
متد ComponentManager.getComponents().
تمام قطعات را با قابلیت مشخص شده دریافت می کند.
امضا:
getComponents<T extends IComponent>(capability: string | Capability<T>, sorted: boolean): T[];
پارامترها
پارامتر | تایپ کنید | توضیحات |
---|
قابلیت | رشته | قابلیت<T> | قابلیت قطعه. |
مرتب شده است | بولی | آیا به لیست مرتب شده بر اساس وزن. |
برمی گرداند:
T[]
اجزایی که با قابلیت مشخص شده مطابقت دارند.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-01-05 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-01-05 بهوقت ساعت هماهنگ جهانی."],[[["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"]]