vue element-ui tree 节点加虚线,样式修改

   
        
{{ node.label }} ({{data.space_property_name}})

1、给indent="0",不要前面的缩进、

2、加样式

.el-tree-node{
  position: relative;
  padding-left: 16px;
}
.el-tree-node__children{
  padding-left: 16px;
}
.el-tree-node :last-child:before {
  height: 38px;
}
.el-tree>.el-tree-node:before{
  border-left: none;
}
.el-tree>.el-tree-node:after{
  border-top: none;
}
.el-tree-node:before,.el-tree-node:after{
  content: "";
  left: -4px;
  position: absolute;
  right: auto;
  border-width: 1px;
}
.tree :first-child .el-tree-node:before{
  border-left: none;
}
.el-tree-node:before {
  border-left: 1px dashed #4386c6;
  bottom: 0px;
  height: 100%;
  top: -20px;
  width: 1px;
}
.el-tree-node:after {
  border-top: 1px dashed #4386c6;
  height: 20px;
  top: 17px;
  width: 24px;
}

vue element-ui tree 节点加虚线,样式修改_第1张图片

 

你可能感兴趣的:(vue,element-ui)