naive-ui/demo/documentation/components/menu/enUS/index.demo-entry.md

68 lines
2.7 KiB
Markdown
Raw Normal View History

2019-11-27 17:01:21 +08:00
# Menu
2020-12-12 14:44:44 +08:00
2020-02-02 17:04:47 +08:00
<!--single-column-->
2020-12-12 14:44:44 +08:00
2020-02-07 22:31:26 +08:00
No Food.
2020-12-12 14:44:44 +08:00
2020-02-02 17:04:47 +08:00
## Demos
2020-12-12 14:44:44 +08:00
2019-11-27 17:01:21 +08:00
```demo
2020-02-07 22:31:26 +08:00
horizontal
2020-09-03 23:40:38 +08:00
default-expanded-names
2020-02-07 22:31:26 +08:00
indent
collapse
2020-02-07 22:31:26 +08:00
```
## Props
2020-12-12 14:44:44 +08:00
2020-02-07 22:31:26 +08:00
### Menu Props
2020-12-12 14:44:44 +08:00
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| collapsed-icon-size | `number` | `undefined` | The icon size when menu is collapsed. If not set, menu will use `icon-size` in place of it. |
| collapsed-width | `number` | `undefined` | The menu width after collapsed. |
| collapsed | `boolean` | `false` | The collapsed status of menu, only works when menu is vertical. |
| default-expand-all | `boolean` | `false` | |
| default-expanded-keys | `Array<string>` | `[]` | The default expanded submenu keys of menu in uncontrolled manner. |
| default-value | `string \| null` | `null` | |
| expanded-keys | `Array<string>` | `undefined` | The expanded submenu keys. If set, menu will work in controlled manner and `default-expanded-names` won't work. |
| icon-size | `number` | `20` | The icon size when menu is not collapsed. |
| indent | `number` | `32` | The indend of menu |
| items | `Array<MenuItem \| Submenu \| MenuItemGroup>` | `[]` | Items data of menu. |
| mode | `'vertical' \| 'horizontal'` | `'vertical'` | |
| root-indent | `number` | `undefined` | The indent of menu's first level children. If not set, menu will use `indent` in place of it. |
| theme | `'light' \| 'dark' \| string` | `undefined` | |
| value | `string \| null` | `undefined` | The selected name of menu. |
| on-update:expanded-keys | `(value: string[]) => any` | `undefined` | |
| on-update:value | `(value: string, item: MenuItem) => any` | `undefined` | |
2020-02-07 22:31:26 +08:00
### MenuItem Properties
2020-12-12 14:44:44 +08:00
| Name | Type | Description |
| -------- | ------------- | ---------------------------------------------- |
| disabled | `boolean` | |
| extra | `string` | |
| icon | `() => VNode` | |
| key | `string` | The indentifier of the menu item. **required** |
| title | `string` | |
2020-02-07 22:31:26 +08:00
### Submenu Properties
2020-12-12 14:44:44 +08:00
| Name | Type | Description |
| --- | --- | --- |
| children | `Array<MenuItem \| Submenu \| MenuItemGroup>` | **required** |
| disabled | `boolean` | |
| extra | `string` | |
| icon | `() => VNode` | |
| key | `string` | The indentifier of the submenu. **required** |
| title | `string` | |
2020-02-07 22:31:26 +08:00
### MenuItemGroup Properties
2020-12-12 14:44:44 +08:00
| Name | Type | Description |
| --- | --- | --- |
| children | `Array<MenuItem \| Submenu \| MenuItemGroup>` | **required** |
| key | `string` | 菜单项的标识符,**必需** |
| title | `string` | |
| type | `'group'` | **required** |