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

本文主要介绍了如何通过HTML和CSS调整el-tabs组件的样式,包括移除下划线、更改标签切换线条颜色,以及设置字体和鼠标交互效果。同时,还提到处理数据溢出时的滑动标签功能和使用小技巧快速定位代码部分。
摘要由CSDN通过智能技术生成

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

                   2、标签切换的蓝色线条

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

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

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

  .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 来知道代码对应的是哪一部分

  • 9
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值