论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>
相关推荐
han_几秒前
JavaScript设计模式(二):策略模式实现与应用
前端·javascript·设计模式
x***r1515 分钟前
Notepad++ 8.6 安装教程:详细步骤+自定义安装路径(附注意事项)
linux·前端·javascript
Hilaku7 分钟前
为什么很多工作 5 年的前端,身价反而卡住了?🤷‍♂️
前端·javascript·面试
ai超级个体8 分钟前
前端下午茶:这 3 个网页特效建议收藏(送源码)
前端·three.js·threejs·网页设计·vibe coding·网页灵感·网页分享
维斯188 分钟前
VueFlow 图自适应容器尺寸教程
前端
helloweilei8 分钟前
next/dynamic和React.lazy的区别
前端·next.js
Aaron_Feng12 分钟前
一个小工具解决Swift Actor重入问题
前端
笨笨狗吞噬者12 分钟前
维护 uniapp 小程序端近一年,我想拉一个开发者交流群
前端·程序员·uni-app
前端炒粉18 分钟前
React 面试高频题
前端·react.js·面试
程序员陆业聪20 分钟前
让 Android 里的 AI 真正「干活」:Function Calling 工程实现全解
前端