แบบสำรวจการวิจัย: บอกให้เราทราบเกี่ยวกับประสบการณ์การใช้งาน Blockly
เริ่มแบบสำรวจ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
blockly > ComponentManager > getComponents
เมธอด ComponentManager.getComponents()
รับคอมโพเนนต์ทั้งหมดที่มีความสามารถที่ระบุ
ลายเซ็น:
getComponents<T extends IComponent>(capability: string | Capability<T>, sorted: boolean): T[];
พารามิเตอร์
พารามิเตอร์ |
ประเภท |
คำอธิบาย |
ความสามารถ |
สตริง | ความสามารถ<T> |
ความสามารถของคอมโพเนนต์ |
จัดเรียงแล้ว |
boolean |
เลือกว่าจะส่งคืนรายการโดยเรียงลำดับตามน้ำหนักหรือไม่ |
การคืนสินค้า:
พ[]
คอมโพเนนต์ที่ตรงกับความสามารถที่ระบุ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-08-29 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 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"]]