广告
返回顶部
首页 > 资讯 > 前端开发 > JavaScript >使用ElementUI修改el-tabs标签页组件样式
  • 758
分享到

使用ElementUI修改el-tabs标签页组件样式

使用ElementUIElementUIel-tabs样式修改ElementUI修改el-tabs 2022-11-13 14:11:43 758人浏览 安东尼
摘要

目录ElementUI修改el-tabs标签页组件样式效果图ElementUI的el-tabs标签页样式冲突问题修改样式即可ElementUI修改el-tabs标签页组件样式 官方示

ElementUI修改el-tabs标签页组件样式

官方示例:https://element.eleme.cn/#/zh-CN/component/tabs

效果图

      <el-tabs
        v-model="activeName"
        @tab-click="handleClick"
        :stretch="false"
        style="color: white; height: 300px; width: 100%;caret-color: transparent;"
      >
        <el-tab-pane label="用户管理" name="first">用户管理</el-tab-pane>
        <el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane>
        <el-tab-pane label="角色管理" name="third">角色管理</el-tab-pane>
        <el-tab-pane label="定时任务补偿" name="fourth"
          >定时任务补偿</el-tab-pane
        >
      </el-tabs>

修改CSS

  ::v-deep .el-tabs__content {
    overflow: visible;
  }  
  ::v-deep .el-tabs__item {
    color: white;
  }
  ::v-deep .el-tabs__item.is-active {
    color: #15cbf3;
  }
  ::v-deep .el-icon-arrow-left {
    color: white;
  }
  ::v-deep .el-icon-arrow-right {
    color: white;
  }
  ::v-deep .el-tabs__nav-wrap::after {
    height: 0;
  }
  ::v-deep .el-tabs__active-bar {
    background-color: #15cbf3;
  }

ElementUI的el-tabs标签页样式冲突问题

我这里是用一个标签页套入了另一个标签页,但是所有的最后一个都与其它的对不齐

这是官网代码,不多说,看一下大致逻辑

 <el-tabs :tab-position="tabposition" style="height: 200px;">
    <el-tab-pane label="用户管理">用户管理</el-tab-pane>
    <el-tab-pane label="配置管理">配置管理</el-tab-pane>
    <el-tab-pane label="角色管理">角色管理</el-tab-pane>
    <el-tab-pane label="定时任务补偿">定时任务补偿</el-tab-pane>
  </el-tabs>

修改样式即可

根据自身需要,修改px的数值

.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child {
	padding-right: 10px
}

以上为个人经验,希望能给大家一个参考,也希望大家多多支持编程网。

--结束END--

本文标题: 使用ElementUI修改el-tabs标签页组件样式

本文链接: https://www.lsjlt.com/news/172378.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作