element-ui 中 el-tree 和 el-table 样式调整
创始人
2024-03-18 16:42:42
0

使用 el-tree 和 el-table 时,往往需要根据项目整体环境做一些样式调整,记录一下常用样式。

  • el-tree
    在这里插入图片描述

    
    
    
    
    // 树结构样式调整
    ::v-deep .el-tree {background-color: $bottomContainerBackColor;// 未展开时三角图标颜色.el-icon-caret-right:before {color: #02B3BE;}// 展开时三角图标颜色.el-tree-node__expand-icon.expanded.el-icon-caret-right:before {color: #02B3BE;}// 没有子节点时三角图标颜色(一般不显示).el-tree-node__expand-icon.is-leaf::before {color: rgba(0, 0, 0, 0); // 透明}// 鼠标经过节点时高亮样式.el-tree-node__content:hover {background-color: $bottomContainerBackColor;background: url("~@/assets/bg-tree-item.png") no-repeat;background-size: cover;}// 点击节点左边三角形聚焦时的当前节点样式.el-tree-node:focus>.el-tree-node__content {background-color: $bottomContainerBackColor;}
    }// 当前选中节点的样式
    ::v-deep.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {background-color: $bottomContainerBackColor;background: url("~@/assets/bg-tree-item.png") no-repeat;background-size: cover;
    }// 标签超出宽度显示省略号
    .span-ellipsis {width: 100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;color: #fff; // 字体颜色
    }
    
  • el-table

    在这里插入图片描述

    
    
    .el-table {// thead 背景色.el-table__header-wrapper th {background: #263341!important;}// tbody 背景色.el-table__row {background: $bottomContainerBackColor;}// 表格 body 有数据和无数据时的背景色.el-table__empty-block,.el-table__body-wrapper {background: $bottomContainerBackColor;}// 单元格字体颜色.cell {color: #fff;}// 每行底部边框颜色td, th.is-leaf {border-bottom: 1px solid #4F5153;}
    }.el-table::before {background-color: #4F5153;
    }// table 鼠标经过时当前行高亮
    .el-table--enable-row-hover .el-table__body tr:hover > td{background-color: #374C62;
    }// 滚动条样式
    ::-webkit-scrollbar {background: $bottomContainerBackColor!important;
    }// 滚动条下背景
    ::-webkit-scrollbar-track {background-color: #2d3f51!important;
    }
    

PS: $bottomContainerBackColor 是 scss 变量:$bottomContainerBackColor: #2D3F51;

相关内容

热门资讯

AWSECS:访问外部网络时出... 如果您在AWS ECS中部署了应用程序,并且该应用程序需要访问外部网络,但是无法正常访问,可能是因为...
银河麒麟V10SP1高级服务器... 银河麒麟高级服务器操作系统简介: 银河麒麟高级服务器操作系统V10是针对企业级关键业务...
AWSElasticBeans... 在Dockerfile中手动配置nginx反向代理。例如,在Dockerfile中添加以下代码:FR...
【NI Multisim 14...   目录 序言 一、工具栏 🍊1.“标准”工具栏 🍊 2.视图工具...
​ToDesk 远程工具安装及... 目录 前言 ToDesk 优势 ToDesk 下载安装 ToDesk 功能展示 文件传输 设备链接 ...
北信源内网安全管理卸载 北信源内网安全管理是一款网络安全管理软件,主要用于保护内网安全。在日常使用过程中,卸载该软件是一种常...
AWR报告解读 WORKLOAD REPOSITORY PDB report (PDB snapshots) AW...
AWS管理控制台菜单和权限 要在AWS管理控制台中创建菜单和权限,您可以使用AWS Identity and Access Ma...
群晖外网访问终极解决方法:IP... 写在前面的话 受够了群晖的quickconnet的小水管了,急需一个新的解决方法&#x...
不能访问光猫的的管理页面 光猫是现代家庭宽带网络的重要组成部分,它可以提供高速稳定的网络连接。但是,有时候我们会遇到不能访问光...