2020-02-04 22:07:55 +08:00
|
|
|
|
# 下拉菜单 Dropdown
|
|
|
|
|
当你想触发一些操作的时候。
|
|
|
|
|
|
|
|
|
|
## 演示
|
2019-12-14 02:05:31 +08:00
|
|
|
|
```demo
|
|
|
|
|
basic
|
|
|
|
|
trigger
|
|
|
|
|
cascade
|
2020-02-04 22:07:55 +08:00
|
|
|
|
placement
|
2019-12-14 02:05:31 +08:00
|
|
|
|
size
|
2020-10-21 23:28:09 +08:00
|
|
|
|
manual-position
|
2019-12-14 02:05:31 +08:00
|
|
|
|
```
|
2020-02-04 22:07:55 +08:00
|
|
|
|
|
|
|
|
|
## Props
|
2020-02-07 23:40:07 +08:00
|
|
|
|
|名称|类型|默认值|说明|
|
2020-02-04 22:07:55 +08:00
|
|
|
|
|-|-|-|-|
|
2020-03-08 19:24:07 +08:00
|
|
|
|
|keyboard|`boolean`|`true`|是否支持键盘操作(注意和其他内容键盘操作可能的冲突)|
|
2020-10-21 23:22:08 +08:00
|
|
|
|
|options|`Array<DropdownOption \| DropdownDivider \| DropdownSubmenu>`|`[]`||
|
|
|
|
|
|size|`'small'\|'medium'\|'large'\|'huge'`|`'medium'`||
|
2020-10-04 04:07:14 +08:00
|
|
|
|
|on-select|`(key: string \| number) => any`|`undefined`||
|
2020-03-08 19:24:07 +08:00
|
|
|
|
|
|
|
|
|
对于其他 Props,参考 [Popover Props](n-popover#Props)。注意 `arrow`, `raw` 属性不可用。
|
|
|
|
|
|
|
|
|
|
### DropdownOption Type
|
|
|
|
|
|属性|类型|说明|
|
|
|
|
|
|-|-|-|
|
2020-10-04 04:07:14 +08:00
|
|
|
|
|icon|`() => VNode`||
|
2020-10-21 23:22:08 +08:00
|
|
|
|
|key|`string \| number`|需要唯一|
|
|
|
|
|
|label|`string`||
|
2020-03-08 19:24:07 +08:00
|
|
|
|
|
|
|
|
|
### DropdownDivider Type
|
|
|
|
|
|属性|类型|说明|
|
|
|
|
|
|-|-|-|
|
|
|
|
|
|type|`'divider'`||
|
2020-10-28 01:00:55 +08:00
|
|
|
|
|key|`string \| number`|需要唯一|
|
2020-03-08 19:24:07 +08:00
|
|
|
|
|
|
|
|
|
### DropdownSubmenu Type
|
|
|
|
|
|属性|类型|说明|
|
|
|
|
|
|-|-|-|
|
2020-10-04 04:07:14 +08:00
|
|
|
|
|type|`'submenu'`||
|
2020-03-08 19:24:07 +08:00
|
|
|
|
|label|`string`||
|
2020-10-04 04:07:14 +08:00
|
|
|
|
|icon|`() => VNode`||
|
|
|
|
|
|key|`string \| number`|需要唯一|
|
2020-03-08 19:24:07 +08:00
|
|
|
|
|children|`Array<DropdownOption \| DropdownDivider \| DropdownSubmenu>`||
|