导航菜单
- Source:
Members
(inner) props
- Source:
Properties:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
Array.<Item> |
<optional> |
菜单项对象数组 Properties
|
|||||||||||||||||||||||||||||||||||||||||
itemWidth |
Number |
<optional> |
150
|
菜单宽度,仅在 horizontal 模式时用做检测宽度用 |
||||||||||||||||||||||||||||||||||||||||
mode |
string |
<optional> |
vertical
|
菜单类型,可选值:'vertical', 'horizontal',现在支持垂直、水平两种模式 |
||||||||||||||||||||||||||||||||||||||||
theme |
string |
<optional> |
light
|
主题颜色, 可选值:'light', 'dark', 'primary' |
||||||||||||||||||||||||||||||||||||||||
router |
boolean |
<optional> |
false
|
是否使用 vue-router 的模式,启用该模式会在激活导航时以 index 作为 path 进行路由跳转 |
||||||||||||||||||||||||||||||||||||||||
defaultActive |
string |
<optional> |
当前激活菜单的 index, router为true时,默认为当前路由path |
|||||||||||||||||||||||||||||||||||||||||
defaultOpeneds |
Array.<String> |
<optional> |
当前打开的 sub-menu 的 index 的数组 |
|||||||||||||||||||||||||||||||||||||||||
uniqueOpened |
boolean |
<optional> |
是否只保持一个子菜单的展开 |
|||||||||||||||||||||||||||||||||||||||||
collapsed |
boolean |
<optional> |
false
|
是否水平折叠收起菜单(仅在 mode 为 vertical 时可用) |
||||||||||||||||||||||||||||||||||||||||
menuTrigger |
string |
<optional> |
hover
|
子菜单打开的触发方式(只在 mode 为 horizontal 时有效) 可选值,'hover', 'click' |
||||||||||||||||||||||||||||||||||||||||
collapseTransition |
boolean |
<optional> |
true
|
是否开启折叠动画 |
||||||||||||||||||||||||||||||||||||||||
submenu |
object |
<optional> |
子菜单配置对象,配置信息参考 ElementUI SubMenu Attribute |
属性参数
(inner) slots
- Source:
Properties:
Name | Type | Description |
---|---|---|
title |
string | 作用域插槽,定义各项目的标题 参数: item 菜单项数据对象 |
插槽
Events
select
- Source:
菜单项选中时触发
Parameters:
Name | Type | Description |
---|---|---|
item |
Object | 菜单项对象 |