docs(components): [menu] More details about usage of default-active (#9030)

* Menu: more details about usage of default-active

`default-active` is required to select an item on page load. If it isn't set, no item is selected when the page first opens.

Added this caveat to `Menu Attributes` section.

* chore: update

Co-authored-by: RealityBoy <1923740402@qq.com>
This commit is contained in:
Juliano Penna 2022-08-31 15:19:01 +02:00 committed by GitHub
parent 637ef1e25f
commit 93631d841e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,20 +47,20 @@ menu/collapse
## Menu Attributes
| Attribute | Description | Type | Accepted Values | Default |
| ------------------- | ---------------------------------------------------------------------------------------------------------- | ------- | --------------------- | -------- |
| mode | menu display mode | string | horizontal / vertical | vertical |
| collapse | whether the menu is collapsed (available only in vertical mode) | boolean | — | false |
| ellipsis | whether the menu is ellipsis (available only in horizontal mode) | boolean | — | true |
| background-color | background color of Menu (hex format) (deprecated, use `--bg-color` instead) | string | — | #ffffff |
| text-color | text color of Menu (hex format) (deprecated, use `--text-color` instead) | string | — | #303133 |
| active-text-color | text color of currently active menu item (hex format) (deprecated, use `--active-color` instead) | string | — | #409EFF |
| default-active | index of currently active menu | string | — | — |
| default-openeds | array that contains indexes of currently active sub-menus | Array | — | — |
| unique-opened | whether only one sub-menu can be active | boolean | — | false |
| menu-trigger | how sub-menus are triggered, only works when `mode` is 'horizontal' | string | hover / click | hover |
| router | whether `vue-router` mode is activated. If true, index will be used as 'path' to activate the route action | boolean | — | false |
| collapse-transition | whether to enable the collapse transition | boolean | — | true |
| Attribute | Description | Type | Accepted Values | Default |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | --------------------- | -------- |
| mode | menu display mode | string | horizontal / vertical | vertical |
| collapse | whether the menu is collapsed (available only in vertical mode) | boolean | — | false |
| ellipsis | whether the menu is ellipsis (available only in horizontal mode) | boolean | — | true |
| background-color | background color of Menu (hex format) (deprecated, use `--bg-color` instead) | string | — | #ffffff |
| text-color | text color of Menu (hex format) (deprecated, use `--text-color` instead) | string | — | #303133 |
| active-text-color | text color of currently active menu item (hex format) (deprecated, use `--active-color` instead) | string | — | #409EFF |
| default-active | index of active menu on page load | string | — | — |
| default-openeds | array that contains indexes of currently active sub-menus | Array | — | — |
| unique-opened | whether only one sub-menu can be active | boolean | — | false |
| menu-trigger | how sub-menus are triggered, only works when `mode` is 'horizontal' | string | hover / click | hover |
| router | whether `vue-router` mode is activated. If true, index will be used as 'path' to activate the route action. Use with `default-active` to set the active item on load. | boolean | — | false |
| collapse-transition | whether to enable the collapse transition | boolean | — | true |
## Menu Methods