研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly >FieldDropdown >onItemSelected_
FieldDropdown.onItemSelected_() 方法
处理下拉菜单中的项选择。
Signature:
protected onItemSelected_(menu: Menu, menuItem: MenuItem): void;
参数
参数 |
类型 |
说明 |
菜单 |
菜单 |
已点击的“菜单”组件。 |
menuItem |
MenuItem |
在菜单中选择的 MenuItem。 |
返回:
void
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-10。
[null,null,["最后更新时间 (UTC):2024-09-10。"],[[["The `onItemSelected_` method is called when a user selects an item from a FieldDropdown's menu."],["It receives the `Menu` and selected `MenuItem` as input, allowing developers to react to the user's choice."],["This method is intended for internal use and doesn't return any value."]]],["The `onItemSelected_` method within the `FieldDropdown` class handles dropdown menu item selection. It receives two parameters: `menu`, representing the clicked `Menu` component, and `menuItem`, representing the selected `MenuItem` within that menu. This method processes the specific `MenuItem` choice and performs actions based on the selection within a `FieldDropdown`, it does not return a value.\n"]]