mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
Fix dropdown click usecase, ref #535
This commit is contained in:
parent
de78d5e33c
commit
ffcf55d241
@ -8,11 +8,11 @@
|
||||
|
||||
````jsx
|
||||
import { Menu, Dropdown, Button, Icon } from 'antd';
|
||||
const onSelect = function ({key}){
|
||||
alert('选中了菜单' + key);
|
||||
const onClick = function({key}) {
|
||||
console.log('点击了菜单' + key);
|
||||
};
|
||||
|
||||
const menu = <Menu onSelect={onSelect}>
|
||||
const menu = <Menu onClick={onClick}>
|
||||
<Menu.Item key="1">第一个菜单项</Menu.Item>
|
||||
<Menu.Item key="2">第二个菜单项</Menu.Item>
|
||||
<Menu.Item key="3">第三个菜单项</Menu.Item>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|-------------|------------------|--------------------|--------------|
|
||||
| trigger | 触发下拉的行为 | "click" or "hover" | hover |
|
||||
| overlay | 菜单节点 | React.Element | 无 |
|
||||
| onSelect | 选择后的回调 | function(e) {} | 无 |
|
||||
| onClick | 点击菜单后的回调 | function({key,keyPath,item,domEvent}) {} | 无 |
|
||||
|
||||
|
||||
菜单可由 `antd.Menu` 取得,可设置 `onSelect` 回调,菜单还包括菜单项 `antd.Menu.Item`,分割线 `antd.Menu.Divider`。
|
||||
|
Loading…
Reference in New Issue
Block a user