覆盖el-tree的样式:
- 需要覆盖鼠标hover元素时,元素的背景色;
- 需要覆盖鼠标点击元素后,元素的背景色,点击其他区域恢复原来背景色;
::v-deep .el-tree{
// 修改鼠标hover时背景色
.el-tree-node__content:hover{
background-color: #2c526a !important;
}
// 修改点击元素后的背景色
.el-tree-node:focus > .el-tree-node__content {
background-color: #2c526a !important;
}
}