mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-29 18:50:00 +08:00
update Dropdown demo code style
This commit is contained in:
parent
88800524dd
commit
7e142a7aa5
@ -9,10 +9,9 @@
|
||||
````jsx
|
||||
var Menu = antd.Menu;
|
||||
var Dropdown = antd.Dropdown;
|
||||
|
||||
function onClick(key){
|
||||
var onClick = function (key){
|
||||
alert('选中了菜单' + key);
|
||||
}
|
||||
};
|
||||
|
||||
var menu = <Menu onClick={onClick}>
|
||||
<Menu.Item key="1">第一个菜单项</Menu.Item>
|
||||
@ -21,7 +20,6 @@ var menu = <Menu onClick={onClick}>
|
||||
<Menu.Item key="4" disabled>第四个菜单项</Menu.Item>
|
||||
</Menu>;
|
||||
|
||||
|
||||
React.render(
|
||||
<Dropdown overlay={menu}>
|
||||
<button className="ant-btn ant-btn-ghost">
|
||||
|
@ -21,18 +21,16 @@ var menu = <Menu>
|
||||
<Menu.Item key="3">第三个菜单项</Menu.Item>
|
||||
</Menu>;
|
||||
|
||||
React.render(
|
||||
<div>
|
||||
<Dropdown overlay={menu} trigger="click">
|
||||
<button className="ant-btn ant-btn-ghost">
|
||||
点我下来 <i className="anticon anticon-caret-down"></i>
|
||||
</button>
|
||||
</Dropdown>
|
||||
<Dropdown overlay={menu}>
|
||||
<button className="ant-btn ant-btn-ghost">
|
||||
鼠标移入 <i className="anticon anticon-caret-down"></i>
|
||||
</button>
|
||||
</Dropdown>
|
||||
</div>
|
||||
, document.getElementById('components-dropdown-demo-trigger'));
|
||||
React.render(<div>
|
||||
<Dropdown overlay={menu} trigger="click">
|
||||
<button className="ant-btn ant-btn-ghost">
|
||||
点我下来 <i className="anticon anticon-caret-down"></i>
|
||||
</button>
|
||||
</Dropdown>
|
||||
<Dropdown overlay={menu}>
|
||||
<button className="ant-btn ant-btn-ghost">
|
||||
鼠标移入 <i className="anticon anticon-caret-down"></i>
|
||||
</button>
|
||||
</Dropdown>
|
||||
</div>, document.getElementById('components-dropdown-demo-trigger'));
|
||||
````
|
||||
|
Loading…
Reference in New Issue
Block a user