2024-07-03 13:55:34 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
numberSteps: Number,
|
|
|
|
currentStep: Number,
|
|
|
|
color: String
|
|
|
|
});
|
|
|
|
|
|
|
|
const cssVars = computed(() => {
|
|
|
|
return {
|
|
|
|
'--color': props.color
|
2022-10-07 14:15:53 +00:00
|
|
|
}
|
2024-07-03 13:55:34 +00:00
|
|
|
});
|
2022-10-07 14:15:53 +00:00
|
|
|
</script>
|
2024-07-03 13:55:34 +00:00
|
|
|
|
|
|
|
<template>
|
|
|
|
<div :style="cssVars" class="progress">
|
|
|
|
<span v-for="step in numberSteps" :key="step" class="step" :class="{ active: step <= currentStep }"></span>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-10-07 14:15:53 +00:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
@import "assets/css/color";
|
|
|
|
@import "assets/css/spacing";
|
|
|
|
|
|
|
|
.progress {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
2024-07-03 13:55:34 +00:00
|
|
|
|
2022-10-07 14:15:53 +00:00
|
|
|
.step {
|
|
|
|
border-radius: 2px;
|
|
|
|
border: 6px solid $gray_2;
|
2024-07-03 13:55:34 +00:00
|
|
|
margin: $small $xxx_small;
|
2022-10-07 14:15:53 +00:00
|
|
|
width: 30px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.active {
|
|
|
|
border-color: var(--color);
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|