论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>
相关推荐
To_OC12 小时前
LC 207 课程表:刚学图论那会儿,我连这是拓扑排序都没看出来
javascript·算法·leetcode
To_OC12 小时前
LC 208 实现 Trie 前缀树:曾被名字劝退,写完发现是送分题
javascript·算法·leetcode
天渺工作室12 小时前
实现一个adblock/adblock plus等浏览器广告拦截器检测插件
前端·javascript
阳光是sunny13 小时前
Vue 项目怎么做用户行为全链路监控?轻量插件方案详解
前端·面试·架构
ZhengEnCi13 小时前
Q04-Vite禁用CSS代码分割-解决生产环境样式加载顺序混乱问题
前端·vue.js·vite
九酒13 小时前
AI Agent 开发踩坑记:口播功能非得用 APP 原生实现吗?
前端·人工智能·agent
Jackson__14 小时前
做了一段时间的AI coding后,我终于搞清了 CLI 和 MCP 的区别
前端·agent·ai编程
IT_陈寒17 小时前
JavaScript项目实战经验分享
前端·人工智能·后端
用户479492835691517 小时前
6w star,GitHub 趋势第一的 Ponytail,这个agent插件到底在火什么
前端·后端
薛定喵的谔19 小时前
我开源了一个精致的 Next.js 博客模板:Skyplume
前端·前端框架·next.js