局部换肤(切换用户局部颜色改变)
<div class="active_content" :class="{'active_content_teacher': roleId==2,'active_content_student': roleId==1}">
- 将相同的css写在一起,不同的封装起来,通过用户切换换肤
@mainTeacherColor: #14ca91;
@mainStudentColor: #f48f5b;
.tab_header_student{
background: @mainStudentColor;
}
.active_content_student{
.el-tabs__item.is-active, .el-tabs__item:hover{
background-color: @mainStudentColor !important;
}
}
.tab_header_teacher{
background: @mainTeacherColor;
}
.active_content_teacher{
.el-tabs__item.is-active, .el-tabs__item:hover{
background-color: @mainTeacherColor !important;
}
}