论el-menu自定义样式

最终效果:

原始效果:

相关代码:

html 复制代码
<!-- 菜单 -->
          <div class="button-manage-right">
            <el-menu
              :default-active="activeIndex"
              class="el-menu-demo"
              mode="horizontal"
              @select="handleSelect"
            >
              <el-menu-item
                v-for="item in currentCommandInfo.functionArr"
                :key="item.functionId"
                :index="item.functionId"
                >{{ item.functionName }}</el-menu-item
              >
            </el-menu>
          </div>
css 复制代码
<style lang="less" scoped>
// 修改菜单的样式
.button-manage-right {
  & ::v-deep .el-menu {
    background-color: transparent;
  }
  & ::v-deep .el-menu.el-menu--horizontal {
    height: 100%;
    border-bottom: none;
  }
  & ::v-deep .el-menu--horizontal > .el-menu-item {
    height: 100%;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  & ::v-deep .el-menu--horizontal > .el-menu-item:hover {
    background-color: #2c3c7a;
    border-bottom-color: #2c3c7a;
  }
  & ::v-deep .el-menu--horizontal > .el-menu-item.is-active {
    background-color: #2c3c7a;
    border-bottom-color: #2c3c7a;
  }
}
</style>
相关推荐
灵感__idea6 小时前
Hello 算法:“走一步看一步”的智慧
前端·javascript·算法
吴文周7 小时前
告别重复劳动:一套插件让 AI 替你写代码、修Bug、做测试、上生产
前端·后端·ai编程
Mh8 小时前
我决定写一个 3D 地球仪来记录下我要去的地方
前端·javascript·动效
yaoxin5211238 小时前
390. Java IO API - WatchDir 示例
java·前端·python
懒狗小前端8 小时前
做了一个 codex 的中文文档网站,做的不好可以随便喷
前端·后端
. . . . .9 小时前
ref、useRef 和 forwardRef
前端·javascript·react.js
energy_DT9 小时前
2026年海上钻井平台数字孪生平台:引领海洋能源数字化转型
前端
Eric_见嘉10 小时前
在职前端 Agent 配置分享
前端·后端·agent
柚子81610 小时前
break跳出语句块的神奇技巧
前端·javascript
ejinxian11 小时前
Rust GUI框架Azul与Electron、WebView2
前端·javascript·electron