1.elementUI的树形组件官网样例节点之间是没有连线的,想要实现如下图节点之间出现连线需要自己定义树形插件的样式覆盖el-tree内部的样式类
首先要给el-tree添加两个样式类
一个添加到el-tree本身的class上,另外一个添加到包裹el-tree的外层div,具体的样式代码如下
/* 树形结构节点添加连线 */
.tree /deep/ .el-tree-node {
position: relative;
padding-left: 16px;
}
.tree /deep/ .el-tree-node__children {
padding-left: 16px;
}
.tree /deep/ .el-tree-node :last-child:before {
height: 38px;
}
.tree /deep/ .el-tree > .el-tree-node:before {
border-left: none;
}
.tree-container /deep/ .el-tree > .el-tree-node:after {
border-top: none;
}
.tree /deep/ .el-tree-node:before {
content: "";
left: -4px;
position: absolute;
right: auto;
border-width: 1px;
}
.tre