|
@@ -4,7 +4,7 @@
|
|
|
padding-left: 55px;
|
|
|
}
|
|
|
.el-menu-vertical-demo:not(.el-menu--collapse) {
|
|
|
- width: 200px;
|
|
|
+ width: 240px;
|
|
|
min-height: 400px;
|
|
|
}
|
|
|
.line {
|
|
@@ -59,9 +59,9 @@ Menu that provides navigation for your website.
|
|
|
|
|
|
Top bar NavMenu can be used in a variety of scenarios.
|
|
|
|
|
|
-::: demo By default Menu is vertical, but you can change it to horizontal by setting the mode prop to 'horizontal'. In addition, you can use the submenu component to create a second level menu.
|
|
|
+::: demo By default Menu is vertical, but you can change it to horizontal by setting the mode prop to 'horizontal'. In addition, you can use the submenu component to create a second level menu. Menu provides `background-color`, `text-color` and `active-text-color` to customize the colors.
|
|
|
```html
|
|
|
-<el-menu theme="dark" :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
|
|
|
+<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
|
|
|
<el-menu-item index="1">Processing Center</el-menu-item>
|
|
|
<el-submenu index="2">
|
|
|
<template slot="title">Workspace</template>
|
|
@@ -72,7 +72,14 @@ Top bar NavMenu can be used in a variety of scenarios.
|
|
|
<el-menu-item index="3"><a href="https://www.ele.me" target="_blank">Orders</a></el-menu-item>
|
|
|
</el-menu>
|
|
|
<div class="line"></div>
|
|
|
-<el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal" @select="handleSelect">
|
|
|
+<el-menu
|
|
|
+ :default-active="activeIndex2"
|
|
|
+ class="el-menu-demo"
|
|
|
+ mode="horizontal"
|
|
|
+ @select="handleSelect"
|
|
|
+ background-color="#545c64"
|
|
|
+ text-color="#fff"
|
|
|
+ active-text-color="#ffd04b">
|
|
|
<el-menu-item index="1">Processing Center</el-menu-item>
|
|
|
<el-submenu index="2">
|
|
|
<template slot="title">Workspace</template>
|
|
@@ -108,11 +115,18 @@ Vertical NavMenu with sub-menus.
|
|
|
::: demo You can use the el-menu-item-group component to create a menu group, and the name of the group is determined by the title prop or a named slot.
|
|
|
```html
|
|
|
<el-row class="tac">
|
|
|
- <el-col :span="8">
|
|
|
- <h5>With icons</h5>
|
|
|
- <el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
|
|
|
+ <el-col :span="12">
|
|
|
+ <h5>Default colors</h5>
|
|
|
+ <el-menu
|
|
|
+ default-active="2"
|
|
|
+ class="el-menu-vertical-demo"
|
|
|
+ @open="handleOpen"
|
|
|
+ @close="handleClose">
|
|
|
<el-submenu index="1">
|
|
|
- <template slot="title"><i class="el-icon-message"></i>Navigator One</template>
|
|
|
+ <template slot="title">
|
|
|
+ <i class="el-icon-message"></i>
|
|
|
+ <span>Navigator One</span>
|
|
|
+ </template>
|
|
|
<el-menu-item-group title="Group One">
|
|
|
<el-menu-item index="1-1">item one</el-menu-item>
|
|
|
<el-menu-item index="1-2">item one</el-menu-item>
|
|
@@ -125,18 +139,34 @@ Vertical NavMenu with sub-menus.
|
|
|
<el-menu-item index="1-4-1">item one</el-menu-item>
|
|
|
</el-submenu>
|
|
|
</el-submenu>
|
|
|
- <el-menu-item index="2"><i class="el-icon-menu"></i>Navigator Two</el-menu-item>
|
|
|
- <el-menu-item index="3"><i class="el-icon-setting"></i>Navigator Three</el-menu-item>
|
|
|
+ <el-menu-item index="2">
|
|
|
+ <i class="el-icon-menu"></i>
|
|
|
+ <span>Navigator Two</span>
|
|
|
+ </el-menu-item>
|
|
|
+ <el-menu-item index="3">
|
|
|
+ <i class="el-icon-setting"></i>
|
|
|
+ <span>Navigator Three</span>
|
|
|
+ </el-menu-item>
|
|
|
</el-menu>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <h5>Without icons</h5>
|
|
|
- <el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" theme="dark">
|
|
|
+ <el-col :span="12">
|
|
|
+ <h5>Custom colors</h5>
|
|
|
+ <el-menu
|
|
|
+ default-active="2"
|
|
|
+ class="el-menu-vertical-demo"
|
|
|
+ @open="handleOpen"
|
|
|
+ @close="handleClose"
|
|
|
+ background-color="#545c64"
|
|
|
+ text-color="#fff"
|
|
|
+ active-text-color="#ffd04b">
|
|
|
<el-submenu index="1">
|
|
|
- <template slot="title">Navigator One</template>
|
|
|
+ <template slot="title">
|
|
|
+ <i class="el-icon-message"></i>
|
|
|
+ <span>Navigator One</span>
|
|
|
+ </template>
|
|
|
<el-menu-item-group title="Group One">
|
|
|
<el-menu-item index="1-1">item one</el-menu-item>
|
|
|
- <el-menu-item index="1-2">item two</el-menu-item>
|
|
|
+ <el-menu-item index="1-2">item one</el-menu-item>
|
|
|
</el-menu-item-group>
|
|
|
<el-menu-item-group title="Group Two">
|
|
|
<el-menu-item index="1-3">item three</el-menu-item>
|
|
@@ -146,21 +176,14 @@ Vertical NavMenu with sub-menus.
|
|
|
<el-menu-item index="1-4-1">item one</el-menu-item>
|
|
|
</el-submenu>
|
|
|
</el-submenu>
|
|
|
- <el-menu-item index="2">Navigator Two</el-menu-item>
|
|
|
- <el-menu-item index="3">Navigator Three</el-menu-item>
|
|
|
- </el-menu>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <h5>Groups</h5>
|
|
|
- <el-menu mode="vertical" default-active="1" class="el-menu-vertical-demo">
|
|
|
- <el-menu-item-group title="Group One">
|
|
|
- <el-menu-item index="1"><i class="el-icon-message"></i>Navigator One</el-menu-item>
|
|
|
- <el-menu-item index="2"><i class="el-icon-message"></i>Navigator Two</el-menu-item>
|
|
|
- </el-menu-item-group>
|
|
|
- <el-menu-item-group title="Group Two">
|
|
|
- <el-menu-item index="3"><i class="el-icon-message"></i>Navigator Three</el-menu-item>
|
|
|
- <el-menu-item index="4"><i class="el-icon-message"></i>Navigator Four</el-menu-item>
|
|
|
- </el-menu-item-group>
|
|
|
+ <el-menu-item index="2">
|
|
|
+ <i class="el-icon-menu"></i>
|
|
|
+ <span>Navigator Two</span>
|
|
|
+ </el-menu-item>
|
|
|
+ <el-menu-item index="3">
|
|
|
+ <i class="el-icon-setting"></i>
|
|
|
+ <span>Navigator Three</span>
|
|
|
+ </el-menu-item>
|
|
|
</el-menu>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -251,6 +274,9 @@ Vertical NavMenu could be collapsed.
|
|
|
|---------- |-------- |---------- |------------- |-------- |
|
|
|
| mode | menu display mode | string | horizontal/vertical | vertical |
|
|
|
| collapse | whether the menu is collapsed (available only in vertical mode) | boolean | — | false |
|
|
|
+| background-color | background color of Menu (hex format) | string | — | #ffffff |
|
|
|
+| text-color | text color of Menu (hex format) | string | — | #2d2f33 |
|
|
|
+| active-text-color | text color of currently active menu item (hex format) | string | — | #1989fa |
|
|
|
| theme | theme color | string | light/dark | light |
|
|
|
| default-active | index of currently active menu | string | — | — |
|
|
|
| default-openeds | array that contains keys of currently active sub-menus | Array | — | — |
|