element-ui el-tabs el-tab-pane 的使用

实现效果:1、去掉它的下划线

2、标签切换的蓝色线条

3、字体,鼠标滑过字体、点击的字体

4、如果数据超出,出现左右滑动标签

html

html 复制代码
     <div class="activity">
         <div class="cont">
            <el-tabs
              v-if="search && search.length > 0"
              v-model="first"
              @tab-click="handleClick"
            >
               <el-tab-pane
            v-for="(item, index) in search"
            :key="index"
            :label="item.category_name"
            :name="item.id"
            :lazy="true"
            >
              </el-tab-pane>

    </el-tabs>
         </div>
      </div>

css

css 复制代码
  .activity{
     width:98%;
     height:58px;
     background-color: #ffffff;
     margin:0 auto;
     margin-top: 34px;
     display: flex;
     align-items: center;
     position: relative;
     i{
      font-size: 25px;
      color:#2d97ff
     }
     .lefts{
       position: absolute;
       left:18px
     }
     .rights{
         position: absolute;
         right:18px
     }
     .cont{
      width:100%;
      height:100%;
      margin:  0 auto;
      display: flex;
      flex-direction:row;
      font-size: 20px;
      color: #c8c8c8;
      span{
         display: inline-block;
         height: 100%;
         display: flex;
         align-items: center;
         padding-left: 10px;
         padding-right: 10px;
         margin-right: 18px;
         font-size: 20px;
      }
     }
   }
   ::v-deep {
    .el-tabs {
      height: 100%;
      overflow: hidden;
      display: flex;
      overflow: hidden;
      flex-direction: column;
      .el-tabs__active-bar{
            background-color:transparent !important;
         }
      .el-tabs__header {
        padding: 0 5px;
        height: 100%;
        margin: 0;
        .el-tabs__nav-scroll {
          height: 58px;
          .el-tabs__nav {
            width: auto;
            display: flex;
            justify-content: space-between;
          }
          .el-tabs__item {
            height: 58px;
            font-weight: 400;
            font-size: 20px;
            padding: 0px 22px;
            line-height: 58px;
            margin-right: 42px;
            color:#666666;
            margin-left: 18px;
          }
          .el-tabs__item:hover{
            color: #3299ff;
          }
     
          .el-tabs__item.is-active {
            background-color: #0387fd;
            color:white;
            border:none
          }
        }
        .el-tabs__nav-prev,
        .el-tabs__nav-next {
          .el-icon-arrow-left,
          .el-icon-arrow-right {
            font-size: 20px;
            color:#0387fd;
            line-height: 58px;
            font-weight: 600;
          }
        }
      }
      .el-tabs__content {
        flex: 1;
        padding: 0;
        display: flex;
        overflow: hidden;
        flex-direction: column;
        border-top: 11px solid #f0f2f5;
        .el-tab-pane {
          flex: 1;
          padding: 0;
          display: flex;
          overflow: hidden;
          flex-direction: column;
        }
      }
    }
  }

小技巧:使用的时候可以通过改变font-size,color 来知道代码对应的是哪一部分

相关推荐
呜喵王阿尔萨斯11 分钟前
C/C++ const -- 多义混乱
c语言·开发语言·c++
__log11 分钟前
幂等性设计:从“重复提交“到“稳如磐石“的系统防护
java·开发语言·spring boot
spider_xcxc12 分钟前
Helm 部署 K8s 集群完整笔记
java·开发语言·kubernetes
海清河晏11113 分钟前
Qt实战:从零构建美化登录界面
开发语言·c++·qt
一只小灿灿23 分钟前
C++ 各类特殊符号、运算符
开发语言·c++
寒水馨25 分钟前
macOS下载、安装electron-v43.2.0(附安装包electron-v43.2.0-darwin-arm64.zip)
javascript·macos·electron·node.js·跨平台·桌面应用开发·开源框架
Fu_Lin_26 分钟前
《Qt嵌入式从零基础到精通》前言与阅读指南
开发语言·qt
名字还没想好☜30 分钟前
Go 的 select 实战:超时、非阻塞收发与优雅退出的三个套路
开发语言·数据库·golang·go·并发
geovindu31 分钟前
java: Backtracking Algorithm
java·开发语言·windows·后端·算法·回溯算法
光影少年1 小时前
RN 路由栈管理、页面销毁、返回拦截
javascript·react native·react.js