Fix dropdown click usecase, ref #535

This commit is contained in:
afc163 2015-11-20 14:26:59 +08:00
parent de78d5e33c
commit ffcf55d241
2 changed files with 4 additions and 4 deletions

View File

@ -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>

View File

@ -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`