el-tabs样式修改

<template>
  <div class="main">
    <el-tabs v-model="activeName" class="demo-tabs" @tab-change="handleClick">
      <template v-for="item in list" :key="item.name">
        <el-tab-pane :label="item.label" :name="item.name">{{ item.name }}
          <component :is="item.name" :ref="item.name + 'Ref'" :activeName='activeName'></component>
        </el-tab-pane>
      </template>
    </el-tabs>
  </div>


</template>
<script>
import { ref, toRefs, onMounted, onUnmounted, nextTick, watch, reactive, defineComponent } from 'vue'
import Quality from './ceshi/HeatingQuality.vue'
import Forecast from './ceshi/HeatSupplyForecast.vue'
export default defineComponent({
  components: {
    Quality,
    Forecast
  },
  emits: ['ActiveNameChange'],
  setup(props, { emit }) {
    const state = reactive({
      list: [
        { label: 'xxxx', name: 'Quality' },
        { label: 'xxxx', name: 'Forecast' },
        { label: 'xxxx', name: 'Energy' },
        { label: 'xxxx', name: 'Leak' },
        { label: 'xxxx', name: 'Patrol' },
      ],
      activeName: 'Quality',
      QualityRef: null,
      ForecastRef: null,
    })

    const methods = {
      handleClick(tab) {
        console.log(tab)
      }
    }
    onMounted(() => {
    })
    onUnmounted(() => {
    });
    return {
      ...toRefs(state),
      ...methods,
    }
  }
})
</script>



<style scoped lang="less">
.main {
  margin: 20px;
}
.demo-tabs>.el-tabs__content {
  padding: 32px;
  color: #6b778c;
  font-size: 32px;
  font-weight: 600;
}

:deep(.el-tabs__header) {
  width: fit-content;
}

:deep(.el-tabs) {
  --el-tabs-header-height: 37px;
}

// 隐藏底部横线
:deep(.el-tabs__nav-wrap:after) {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0px; // 改为0
  background-color: var(--el-border-color-light);
  z-index: var(--el-index-normal);
}

:deep(.el-tabs__nav) {
  box-shadow: 5px 5px 10px rgba(0, 0, 0, .1), -5px -5px 10px rgba(0, 0, 0, .1);
  border-radius: 5px;
  background-color: #fff;
  padding: 0 15px;
}

:deep(.el-tabs__active-bar) {
  border-radius: 5px;
  color: #fff;
  padding: 0 12px;
  background-color: #0C52C3;
  bottom: 3px;
  height: 30px;
  left: -12px;
  // list-style: none;
  // position: absolute;
  transition: width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier), transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);
  z-index: 0;
}

:deep(.el-tabs__item.is-active) {
  color: #fff;
}

:deep(.el-tabs__item:hover) {
  // color: #fff;
  cursor: pointer;
}

:deep(.el-tabs__item) {
  padding: 0px 18px;
}
</style>

 

相关推荐

  1. 修改el-select默认样式

    2024-04-25 22:02:03       8 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-25 22:02:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-25 22:02:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-25 22:02:03       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-25 22:02:03       20 阅读

热门阅读

  1. 项目:后台管理系统的开发及自动化部署

    2024-04-25 22:02:03       12 阅读
  2. IOS恢复

    IOS恢复

    2024-04-25 22:02:03      11 阅读
  3. 自定义sink

    2024-04-25 22:02:03       15 阅读
  4. 解决Gradle依赖冲突:排除特定版本依赖

    2024-04-25 22:02:03       12 阅读
  5. 7-云原生监控体系-PromQL-函数功能和示例

    2024-04-25 22:02:03       10 阅读
  6. 简洁易懂递归 | 力扣124.二叉树中的最大路径和

    2024-04-25 22:02:03       11 阅读
  7. socket编程实现TCP通信

    2024-04-25 22:02:03       13 阅读
  8. Day20-Python基础学习之正则表达式和递归(完结)

    2024-04-25 22:02:03       13 阅读
  9. css八股

    2024-04-25 22:02:03       11 阅读
  10. verilog 语法及特点

    2024-04-25 22:02:03       12 阅读