mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
add hover demo
This commit is contained in:
parent
ac2899efbb
commit
3267c220aa
@ -2,7 +2,7 @@
|
||||
|
||||
- order: 0
|
||||
|
||||
点击出发
|
||||
点击触发
|
||||
|
||||
---
|
||||
|
||||
|
30
components/dropdown/demo/hover.md
Normal file
30
components/dropdown/demo/hover.md
Normal file
@ -0,0 +1,30 @@
|
||||
# 基本
|
||||
|
||||
- order: 1
|
||||
|
||||
鼠标触发
|
||||
|
||||
---
|
||||
|
||||
````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 overlay={menu} trigger="hover">
|
||||
<button className="ant-btn ant-btn-ghost">hover <span className="anticon anticon-caret-down"></span></button>
|
||||
</Dropdown>
|
||||
, document.getElementById('components-dropdown-demo-hover'));
|
||||
````
|
@ -18,7 +18,7 @@
|
||||
| 成员 | 说明 | 类型 | 默认值 |
|
||||
|----------|----------------|------------------|--------------|
|
||||
| animation | 动画名称 | String ("slide-up") | 无 |
|
||||
| trigger | 触发下来行为 | "click" or "mouse" | 无 |
|
||||
| trigger | 触发下来行为 | "click" or "hover" | 无 |
|
||||
| overlay | 菜单节点 | React.Element | 无 |
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user