-
效果图
-
在app.vue中直接添加一下代码即可
<style lang="scss">
.el-switch__label--left {
position: relative;
left: 45px;
color: #fff;
z-index: -1111;
}
.el-switch__core{
width: 50px !important;
}
.el-switch__label--right {
position: relative;
right: 46px;
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;
}
</style>
- 开关上的字改为 开 关
active-text=“开”
inactive-text=“关”