<template>
    <div class="step">
        <div class="step-item" :class="{active:nowStep>=(index+1)}" :style="{width:(100/list.length)+'%'}" v-for="(item,index) in list">
            <div class="name">{{item}}</div>
            <div class="box">
                <span>{{index+1}}</span>
            </div>

            <div class="line"></div>
        </div>
    </div>
</template>

<script>

export default {
    props: {
        list: {
            type: Array,
            default: []
        },
        nowStep: {
            type: Number,
            default: 0
        }
    },
    name: 'CertificationStep',
    data() {
        return {

        }
    },
    computed: {

    },
    methods: {

    }
}
</script>

<style lang="less" scoped>
.step {
    font-size: 0;
    .step-item {
        display: inline-block;
        font-size: 14px;
        font-family: MicrosoftYaHei;
        color: rgba(102, 102, 102, 1);
        line-height: 19px;
        text-align: center;
        position: relative;

        .box {
            width: 40px;
            height: 40px;
            background: #eaeaea;
            text-align: center;
            line-height: 40px;
            font-size: 16px;
            font-family: MicrosoftYaHei;
            font-weight: bold;
            color: rgba(247, 247, 247, 1);
            border-radius: 100%;
            margin: auto;
            z-index: 2;
            position: relative;
            margin-top: 12px;
        }

        &:not(:last-child) {
            .line {
                border: 1px dashed rgba(234, 234, 234, 1);
                position: absolute;
                width: 100%;
                left: 50%;
                bottom: 20px;
                z-index: 1;
            }
        }

        &.active {
            .box {
                background: #0b9ec0;
                color: #fff;
            }

            .line {
                border-color: #0b9ec0;
            }
        }
    }
}
</style>
