basic.md 664 字节
Newer Older
Y
yiminghe 已提交
1 2 3 4
# 基本

- order: 0

Y
yiminghe 已提交
5
点击触发
Y
yiminghe 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

---

````jsx
var Menu = antd.Menu;
var Dropdown = antd.Dropdown;

function onClick(key){
 alert('select ' + key);
}

var menu = <Menu style={{width:140}} onClick={onClick}>
  <Menu.Item disabled>disabled</Menu.Item>
  <Menu.Item key="1">第一个菜单项</Menu.Item>
  <Menu.Divider/>
  <Menu.Item key="2">第二个菜单项</Menu.Item>
</Menu>;


React.render(
  <Dropdown animation="slide-up" overlay={menu} trigger="click">
  <button className="ant-btn ant-btn-ghost">点我下来 <span className="anticon anticon-caret-down"></span></button>
  </Dropdown>
, document.getElementById('components-dropdown-demo-basic'));
````