elementUI步骤条:CSS改变步骤条状态样式,进度条跟随到当前步骤,而不是当前步骤完成了才显示颜色。

elementUI 步骤条:https://element.eleme.cn/#/zh-CN/component/steps
原element步骤条:
在这里插入图片描述

状态改变进度条显示:
elementUI步骤条原本的进度条显示是步骤2完成了,1和2之间的进度条才显示。
本CSS改成:走到步骤2,1和2之间的进度条就显示。

改造后效果:
在这里插入图片描述
代码:elementUI步骤条组件的代码,主要是CSS

<template>
  <div class="about">
    <h1>CSS改造elementUI 步骤条样式</h1>
    <div class="theSteps">
      <el-steps :active="active" finish-status="success">
        <el-step title="步骤 1"></el-step>
        <el-step title="步骤 2"></el-step>
        <el-step title="步骤 3"></el-step>
      </el-steps>

      <el-button style="margin-top: 12px;" @click="next">下一步</el-button>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      active: 0,
    };
  },

  methods: {
    next() {
      if (this.active++ > 2) this.active = 0;
    },
  },
};
</script>

<style scoped>
.theSteps {
  width: 1000px;
}
/* 进行中状态:圈线 */
.theSteps >>> .el-step__head.is-process {
  color: #efa73b;
  border-color: #efa73b;
}
/* 进行中状态:圈内 */
.theSteps >>> .el-step__head.is-process > .el-step__icon {
  background: #efa73b;
  color: #fff;
}
/* 进行中状态:title(文字) */
.theSteps >>> .el-step__title.is-process {
  color: #efa73b;
}


/* 完成状态:圈线 */
.theSteps >>> .el-step__head.is-success {
  color: #efa73b;
  border-color: #efa73b;
}
/* 完成状态:title(文字) */
.theSteps >>> .el-step__title.is-success {
  color: #efa73b;
}
/* 完成状态:line
 * 描述:第一步完成,第二步进行时,之间的进度条有颜色
 */
.theSteps
  >>> .el-step__head.is-success
  > .el-step__line
  > .el-step__line-inner {
  width: 100% !important;
  border-width: 1px !important;
}
</style>
  • 10
    点赞
  • 40
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值