只需要给el-tree外层或者自身加上一个css即可
关键样式
/* tree选中变色 */
.selecttree .el-tree-node:focus > .el-tree-node__content {
color: yellow !important;
/*background-color: rgba(135, 206, 235, 0.2);*/
}
el-tree组件
外层
<el-scrollbar height="100%" class="selecttree">
<el-tree :data="videoData" ref="sxttree" node-key="id" default-expand-all='true'
:default-checked-keys="[]" :props="defaultProps" class="tree-style"
:filter-node-method="filterNode" @node-click="nodeclick"/>
</el-scrollbar>
自身
<el-tree :data="videoData" ref="sxttree" node-key="id" default-expand-all='true'
:default-checked-keys="[]" :props="defaultProps" class="tree-style selecttree"
:filter-node-method="filterNode" @node-click="nodeclick"/>
![](https://i-blog.csdnimg.cn/blog_migrate/75f8b696696ecc3b6497f8a8938c2d31.png)