แบบสำรวจการวิจัย: บอกให้เราทราบเกี่ยวกับประสบการณ์การใช้งาน Blockly
เริ่มแบบสำรวจ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
blockly > FieldImage > setOnClickHandler
เมธอด FieldImage.setOnClickHandler()
ตั้งค่าฟังก์ชันที่จะเรียกใช้เมื่อคลิกรูปภาพนี้
ลายเซ็น:
setOnClickHandler(func: ((p1: FieldImage) => void) | null): void;
พารามิเตอร์
พารามิเตอร์ |
ประเภท |
คำอธิบาย |
func |
(p1: FieldImage) => เป็นโมฆะ) | ค่าว่าง |
ฟังก์ชันที่เรียกใช้เมื่อมีการคลิกรูปภาพ หรือ Null เพื่อนำออก |
การคืนสินค้า:
เป็นโมฆะ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eThe \u003ccode\u003esetOnClickHandler\u003c/code\u003e method allows you to assign a function that will be executed when the FieldImage is clicked.\u003c/p\u003e\n"],["\u003cp\u003eThis function can be set to \u003ccode\u003enull\u003c/code\u003e to remove any existing click handler.\u003c/p\u003e\n"],["\u003cp\u003eThe assigned function receives the FieldImage instance as an argument when invoked.\u003c/p\u003e\n"]]],["The `setOnClickHandler` method within the `FieldImage` class sets a function to be executed when an image is clicked. It accepts a single parameter, `func`, which can be a function taking a `FieldImage` object as input or `null` to remove any existing click handler. This method has no return value. The provided function is activated upon a user clicking the associated image within the interface.\n"],null,["[blockly](./blockly.md) \\\u003e [FieldImage](./blockly.fieldimage_class.md) \\\u003e [setOnClickHandler](./blockly.fieldimage_class.setonclickhandler_1_method.md)\n\nFieldImage.setOnClickHandler() method\n-------------------------------------\n\nSet the function that is called when this image is clicked.\n\n**Signature:** \n\n setOnClickHandler(func: ((p1: FieldImage) =\u003e void) | null): void;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|-----------|----------------------------------------------------------------------|---------------------------------------------------------------------------|\n| func | ((p1: [FieldImage](./blockly.fieldimage_class.md)) =\\\u003e void) \\| null | The function that is called when the image is clicked, or null to remove. |\n\n**Returns:**\n\nvoid"]]