element-plus 树形控件el-tree 修改小三角图标

先来看看效果图

element-plus 树形控件el-tree 修改小三角图标_第1张图片
 .el-tree .el-tree-node__expand-icon.expanded {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }

  /* //有子节点 且未展开 */
  .el-tree .el-tree-node.is-focusable .el-tree-node__expand-icon:before {
    background: url('../../../../assets/svg/jia.svg') no-repeat 0 3px;
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    font-size: 16px;
    background-size: 16px;
    padding-right: 18px;
  }

  /* //有子节点 且已展开 */
.el-tree .is-expanded .el-tree-node__expand-icon.expanded:before {
    background: url('../../../../assets/svg/jian.svg') no-repeat 0 3px;
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    font-size: 16px;
    background-size: 16px;
    padding-right: 18px;
  }
   .el-tree-node__expand-icon.is-leaf {
    display: none;
  }

你可能感兴趣的:(css,vue3,el-tree,elementui,element-plus,css)