感觉以后可能还会用到,在此记录一下
场景:
elementui原有的样式:
目标样式:
实现:
html代码:
多加了个居中属性:align-center
<el-steps :active="active" class="steps" align-center finish-status="su***ess">
<el-step title="注册帐号"></el-step>
<el-step title="资料完善" @click.native="handleStep(1)"></el-step>
<el-step title="资料审核" @click.native="handleStep(2)"></el-step>
</el-steps>
css代码:
<style lang="less" scoped>
@publi***olor: #018736;
@publicHeight: 35px;
.steps {
width: 80%;
margin: 20px auto 0;
height: @publicHeight;
::v-deep .el-step{
height: 100%;
.el-step__line{
background-color: rgba(0,0,0,0.15);
margin-right: 30px !important;
margin-left: 105px !important;
top: 50%;
height: 1px;
}
.el-step__icon{
width: @publicHeight;
height: @publicHeight;
font-size: 16px;
border: 1px solid;
.el-step__icon-inner{
font-weight: unset !important;
}
}
.el-step__head.is-process{
color: @publi***olor;
border-color: @publi***olor;
}
.el-step__head.is-su***ess{
color: @publi***olor;
border-color: @publi***olor;
}
.is-process .el-step__icon.is-text{
background: @publi***olor;
color: #fff;
}
.el-step__title.is-process{
color: @publi***olor;
}
.el-step__title.is-su***ess{
color: #565656;
}
.el-step__title{
position: absolute;
top: calc((100% - @publicHeight)/2);
left: calc(50% + 25px);
}
}
}
</style>
ok啦,如果有更优的方法,再优化