论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>
相关推荐
SuperherRo19 分钟前
Web开发-JavaEE应用&SpringBoot栈&SnakeYaml反序列化链&JAR&WAR&构建打包
前端·java-ee·jar·反序列化·war·snakeyaml
大帅不是我22 分钟前
Python多进程编程执行任务
java·前端·python
前端怎么个事23 分钟前
框架的源码理解——V3中的ref和reactive
前端·javascript·vue.js
Ciito27 分钟前
将 Element UI 表格元素导出为 Excel 文件(处理了多级表头和固定列导出的问题)
前端·vue.js·elementui·excel
不爱吃饭爱吃菜1 小时前
uniapp微信小程序一键授权登录
前端·javascript·vue.js·微信小程序·uni-app
heart000_11 小时前
从零开始打造个人主页:HTML/CSS/JS实战教程
javascript·css·html
90后小陈老师2 小时前
3D个人简历网站 5.天空、鸟、飞机
前端·javascript·3d
chenbin___2 小时前
react native text 显示 三行 超出部分 中间使用省略号
javascript·react native·react.js
漫路在线6 小时前
JS逆向-某易云音乐下载器
开发语言·javascript·爬虫·python
不爱吃糖的程序媛6 小时前
浅谈前端架构设计与工程化
前端·前端架构设计