Stepper.vue 2.12 KB
<template>
  <div class="StepperBlock">
    <div id="StepperBody">
      <div id="Step1" class="StepCycle" :class="step === 1 ? '' : 'Step1Finish'">
        <v-icon v-if="step !== 1" id="StepperCheck" >check</v-icon>
        <div v-if="step === 1">1</div>
        <span>设置密码</span>				
      </div>
      <v-divider id="StepDivider" :class="step === 1 ? '' : 'Step1Finish'"></v-divider>
      <div id="Step2" class="StepCycle">
        <div>2</div>
        <span>确认密码</span>
      </div>			
    </div>
  </div>
</template>


<script>
	export default {
		data: () => ({
			
		}),
    props: ['step']
	}
</script>

<style lang="scss" scoped>
		.StepperBlock {
      width: 100vw;

			#StepperBody {
				text-align: center;
				position: relative;
        margin-top: 3.5rem;
        height: 5rem;
        #StepDivider {
          width: 30%;
          height: 2px;
					display: inline-block;
					position: absolute;
					top: 1.2rem;
          right: 35%;
          transition: all 0.3s ease-in-out;          
          
          &.Step1Finish {
            background-color: $gold;
          }
				}
				.StepCycle {
					display: inline-block;
					width: 2.5rem;
					height: 2.5rem;
					border-radius: 2.5rem;
					background-color: #D9D7D7;
					position: absolute;
          top: 0;
          transition: all 0.3s ease-in-out;

          #StepperCheck {
            display: block;
            height: 2.5rem;
            width: 2.5rem;
            line-height: 2.5rem;
            color: #fff;
            transition: all 0.3s ease-in-out;
          }
          
          &.Step1Finish {
            background-image: linear-gradient(-229deg, #DAB269 37%, #E7C78C 87%);
          }

					&#Step1 {
						left: calc(35% - 2.5rem);
					}

					&#Step2 {
            right: calc(35% - 2.5rem);
            clear: left;
					}
					span {
						display:block;
						width: 5rem;
						margin-left: -1.2rem;
						margin-top: 0.7rem;
					}

					div {
						width: 2.5rem;
						height: 2.5rem;
						line-height: 2.5rem;
						text-align: center;
						font-size: 18px;
						color: #000;
						font-weight: bold;
					}
				}
			
			}
		}
</style>