文章抄自: vue elementui 修改步骤条el-steps的样式
1.html
<el-steps :active="active" class="steps" align-center finish-status="success">
<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>
2. Css Code
<style lang="less" scoped>
@publicColor: #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: @publicColor;
border-color: @publicColor;
}
.el-step__head.is-success{
color: @publicColor;
border-color: @publicColor;
}
.is-process .el-step__icon.is-text{
background: @publicColor;
color: #fff;
}
.el-step__title.is-process{
color: @publicColor;
}
.el-step__title.is-success{
color: #565656;
}
.el-step__title{
position: absolute;
top: calc((100% - @publicHeight)/2);
left: calc(50% + 25px);
}
}
}
</style>
3.
<div class="stepComponent" >
<div class="stepsTitle">
<div style="float:left;width:2px;height:20px; background:#219AFF;"></div>
审批流程及意见
</div>
<div class="approvalProcess" >
<el-steps :active="active" finish-status="success" direction="vertical" >
<el-step :title="item.label" v-for="item in approvalProcessProject" :id="item.id">
<template slot="description" >
<div class="step-row" v-for="item in approvalProcessProject">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="processing_content">
<tr>
<td style="color:#98A6BE">
<div class="processing_content_detail" style="float:left;width:70%"><span >申请人 <span style="color:#219AFF">圆领{{}}</span> 提交了割接方案</span></div>
<div class="processing_content_detail" style="float:right;"><span ><i class="el-icon-time"></i> 昨天12:24</span> </div>
</td>
</tr>
<tr>
<td>
<div class="processing_content_detail" style="float:left;width:70%">
<div style="float:left;width: 2px;height: 20px; background:#C7D4E9;margin-left:10px;margin-right:10px"></div>
<span style="color:#919FB8">同意,建议通过</span></div>
</td>
</tr>
</table>
</div>
</template>
</el-step>
</el-steps>
<el-button style="margin-top: 12px;" @click="next">下一步</el-button>
</div>
</div>
</template>
<script>
export default {
components: {
},
props: ['data', 'defaultActive'],
data() {
return {
active: 0,
approvalProcessProject:[
{id:'0',label: "方案制定"},
{ id:'1',label: "割接方案会审"},
{ id:'2',label: "割接审批"},
{ id:'3',label: "审批成功"},
],
};
},
watch: {
},
mounted() {
},
computed: {
},
methods: {
next() {
if (this.active++ > 2) this.active = 0;
},
}
};
</script>
<style scoped>
.stepComponent{
background-color:#DFEBFF;
width: 100%-20px;
padding: 10px 10px 10px 10px;
margin: 10px 10px 10px 10px;
}
.stepsTitle{
margin: 10px 0px 10px 10px ;
}
.approvalProcess{
color: #9EADC4;
font-size: 14px;
/* width: 100%; */
background:#DFEBFF;
margin-left:20px;
margin-right:0px;
margin-top:10px;
}
.processing_content{
background-color: #D9E5F9;
}
.processing_content_detail{
margin-left: 10px;
margin-top: 3.5px;
margin-bottom: 3.5px;
width:150px;
display:inline-block;
}
.step-row{
min-width:500px;
margin-bottom:12px;
margin-top:12px;
}
</style>