vue 基于elment UI tree 组件实现带引导、提示线
2024-08-31 21:49:05
准备工作,先实现 树状组件的基本样式
<span style="height:500px; display:block; overflow-y:auto;" class="mytree">
<el-tree
:data="data"
show-checkbox
:indent="0"
node-key="id"
:default-expand-all="true"
:props="defaultProps"
></el-tree>
</span>
接下来修改css ,注:indent 设置为零,不然线与节点间的间隙会比较大, 我使用的是 scss,less 也行
.mytree /deep/ {
.el-tree > .el-tree-node:after {
border-top: none;
}
.el-tree-node {
position: relative;
padding-left: 16px;
}
//节点有间隙,隐藏掉展开按钮就好了,如果觉得空隙没事可以删掉
.el-tree-node__expand-icon.is-leaf {
display: none;
}
.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 {
content: '';
left: -4px;
position: absolute;
right: auto;
border-width: 1px;
} .el-tree-node:after {
content: '';
left: -4px;
position: absolute;
right: auto;
border-width: 1px;
} .el-tree-node:before {
border-left: 1px solid #c0c4cc;
bottom: 0px;
height: 100%;
top: -26px;
width: 1px;
} .el-tree-node:after {
border-top: 1px solid #c0c4cc;
height: 20px;
top: 12px;
width: 24px;
}
}
完,大功告成!
最新文章
- 【转】搞不清FastCgi与php-fpm之间是个什么样的关系?
- Reader与InputStream两个类中的read()的区别
- Android 广播 BroadcastReceiver
- 摘记 史上最强大的40多个纯CSS绘制的图形(一)
- 解压版mysql安装
- ehcache2.8.3入门示例:hello world
- Struts2中上传图片案列
- scst使用的一些问题
- 电商ERP如何接入智选物流平台?
- 使用Git push时出现的一些问题处理
- COJN 0487 800301红与黑
- Shuffle 的 5步
- 总账追朔各模块SQL
- Shell命令-文件及内容处理之vi、vim
- IISExpress使用64位
- PostgreSQL条件表达式 case when then end
- Core Mvc传值Query、Form、Cookies、Session、TempData、Cache
- 【Core】.NET Core 部署( Docker + CentOS)
- ECMAScript 6 入门之新的数据类型Symbol
- Perl关联数组用法集锦
热门文章
- RF(ride 工具使用)
- Android 10 获取已连接上的蓝牙设备的当前电量
- JMeter Nmon Tool V2.0 插件
- 解决python语言的工具pycharm以及Windows电脑安装pygame模块的问题
- 内存淘汰机制——LRU与LFU
- Tomcat Ghostcat - AJP协议漏洞DEBUG
- README.md编写
- Day_12【集合】扩展案例3_产生10个长度为10,不能重复,由数字0-9,小写字母和大写字母组成的字符串
- HttpClient之Post接口代码范例
- 如何将Altera官方提供的CADENCE.OLB应用于altium Designer中