论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>
相关推荐
鹏毓网络科技1 分钟前
Cursor Rules 文件配置实战:3 个隐藏参数让我每月少写 40% 样板代码
前端·github
没烦恼3013 分钟前
无痕模式下 HTTP\-First 拦截引发的“页面刷新”误判
前端
ZhengEnCi4 分钟前
Q02-Vue-React-index.html完全指南
vue.js·react.js·html
文心快码BaiduComate7 分钟前
从个人提效到组织提效:Comate辅助构建自我进化的AI研发系统
前端·程序员
hunterandroid1 小时前
Compose 状态管理:remember、rememberSaveable 与状态提升
前端
星栈1 小时前
Dioxus 接数据库最容易写歪的 3 个地方:sqlx + SQLite 怎么接才顺
前端·rust·前端框架
晴虹1 小时前
vue3-scroll-more:横向滚动条-元素或页签过多滚动显示处理的组件
前端·vue.js
代码搬运媛1 小时前
Claude 全栈开发专用 Rules 配置
前端
PedroQue991 小时前
uni-router v1.7.0重磅更新:守卫重定向自由掌控
前端·uni-app
Forever7_1 小时前
尤雨溪转发:Vue-tui 0.1 发布!Vue 终于杀进终端!
vue.js