1. Achieve results2. Implementation CodeThe addition of dotted lines to the tree control is mainly achieved by controlling CSS, and the indent number of the tree control can only be 0, so let class="mytree" <div class="mytree"> <!--indent can only be 0--> <el-tree :data="tree_data" :props="defaultProps" @node-click="handleNodeClick" indent="0" :render-content="renderContent" ></el-tree> </div> The css is set to the following code, using <style lang="scss" scoped> ::v-deep .mytree { .el-tree > .el-tree-node:after { border-top: none; } .el-tree-node { position: relative; padding-left: 16px; } //There is a gap between nodes, just hide the expand button, if you think the gap is okay, you can delete it.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 dashed #4386c6; bottom: 0px; height: 100%; top: -26px; width: 1px; } .el-tree-node:after { border-top: 1px dashed #4386c6; height: 20px; top: 12px; width: 24px; } } </style> 3. Other ImplementationsVue implements tree table through element tree control Element-ui implements adding icons to tree control nodes SummarizeThis article ends here. I hope it can be helpful to you. I also hope you can pay more attention to more content on 123WORDPRESS.COM! You may also be interested in:
|
<<: How to hide a certain text in HTML?
Preface: The most commonly used MySQL logical bac...
Docker view process, memory, cup consumption Star...
This article mainly introduces the sample code of...
Problem description: The Linux system's netwo...
Nginx uses a fixed number of multi-process models...
Preface The mysql module (project address is http...
Event loop in js Because JavaScript is single-thr...
Table of contents 1. Directive custom directive 2...
Use the following terminal command to install the...
Table of contents 1. Implementation 2. Problems 3...
Solution to 1449 and 1045 exceptions when connect...
Copy code The code is as follows: <!DOCTYPE ht...
MySQL is a relational database management system ...
Table of contents Primary key constraint Unique p...
Table of contents LAMP architecture 1.Lamp Introd...