dropdown docs improve

pull/1889/head^2
baiyaaaaa 2016-12-20 19:15:38 +08:00 committed by 杨奕
parent b421556144
commit 5fb979f3a6
3 changed files with 294 additions and 251 deletions

View File

@ -104,6 +104,29 @@ Click the triggering element or hover on it.
</el-row>
```
:::
### Menu hiding behavior
Use `hide-on-click` to define if menu closes on clicking.
:::demo By default menu will close when you click on menu items, and it can be turned off by setting hide-on-click to false.
```html
<el-dropdown :hide-on-click="false">
<span class="el-dropdown-link">
Dropdown List<i class="el-icon-caret-bottom el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>Action 1</el-dropdown-item>
<el-dropdown-item>Action 2</el-dropdown-item>
<el-dropdown-item>Action 3</el-dropdown-item>
<el-dropdown-item disabled>Action 4</el-dropdown-item>
<el-dropdown-item divided>Action 5</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
```
:::
### Dropdown Attributes
| Attribute | Description | Type | Accepted Values | Default |
|------------- |---------------- |---------------- |---------------------- |-------- |

View File

@ -147,6 +147,27 @@
```
:::
### 菜单隐藏方式
可以`hide-on-click`属性来配置。
:::demo 下拉菜单默认在点击菜单项后会被隐藏,将`hide-on-click`属性默认为`false`可以关闭此功能。
```html
<el-dropdown :hide-on-click="false">
<span class="el-dropdown-link">
下拉菜单<i class="el-icon-caret-bottom el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>黄金糕</el-dropdown-item>
<el-dropdown-item>狮子头</el-dropdown-item>
<el-dropdown-item>螺蛳粉</el-dropdown-item>
<el-dropdown-item disabled>双皮奶</el-dropdown-item>
<el-dropdown-item divided>蚵仔煎</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
```
:::
### Dropdown Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |

501
yarn.lock

File diff suppressed because it is too large Load Diff