<div class="device-tree"> <el-scrollbar style="height:100%"> <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"> </el-tree> </el-scrollbar> </div> <style> .el-scrollbar .el-scrollbar__wrap { overflow-x: hidden; } .el-tree>.el-tree-node { min- 100%; display:inline-block; } </style>
1.device-tree设置宽和高,
2.el-scollbar设置100%
3.scoped以及样式覆盖问题,保证样式生效就可以实现横向和竖向滚动条
感谢大佬的辛苦奉献,参考:https://blog.csdn.net/qq_34122822/article/details/103609208