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

- order: 0

A
afc163 已提交
5
最简单的下拉菜单。
Y
yiminghe 已提交
6 7 8 9 10 11 12

---

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

A
afc163 已提交
13 14
var menu = <Menu>
  <Menu.Item key="0">
A
afc163 已提交
15
    <a target="_blank" href="http://www.alipay.com/">第一个菜单项</a>
A
afc163 已提交
16 17
  </Menu.Item>
  <Menu.Item key="1">
A
afc163 已提交
18
    <a target="_blank" href="http://www.taobao.com/">第二个菜单项</a>
A
afc163 已提交
19 20
  </Menu.Item>
  <Menu.Item key="3">第三个菜单项</Menu.Item>
Y
yiminghe 已提交
21 22 23
</Menu>;

React.render(
A
afc163 已提交
24
  <Dropdown overlay={menu}>
A
afc163 已提交
25
    <button className="ant-btn ant-btn-default">
A
afc163 已提交
26
      某按钮 <i className="anticon anticon-caret-down"></i>
A
afc163 已提交
27
    </button>
Y
yiminghe 已提交
28 29 30
  </Dropdown>
, document.getElementById('components-dropdown-demo-basic'));
````
A
afc163 已提交
31 32 33 34 35 36

<style>
.code-box-demo .ant-btn {
  margin-right: 6px;
}
</style>