el-switch样式改变
下面是element ui的switch样式 感觉不是我想要的
想变成这个样子的
可以为el-switch添加样式
::v-deep .btnStyle {
.el-switch__core {
width: 60px !important;
}
.el-switch__label--right {
position: relative;
right: 60px;
color: #fff;
z-index: -1111;
}
.el-switch__label--left {
position: relative;
left: 60px;
color: #fff;
z-index: -1111;
}
.el-switch__label--right.is-active {
z-index: 1111;
color: #fff !important;
}
.el-switch__label--left.is-active {
z-index: 1111;
color: #9c9c9c !important;
}
}
专门写一个类 btnStyle 如果style样式有 scoped的话 使用穿透效果 加::v-deep 就可以了