2023-04-14 17:13:28 +02:00
|
|
|
<template>
|
|
|
|
<ul class="dots">
|
2023-05-29 11:33:30 +02:00
|
|
|
<li v-for="n in stepCount" :key="n" :data-is-active="n == activeDot ? true : null"></li>
|
2023-04-14 17:13:28 +02:00
|
|
|
</ul>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'Dots',
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
2023-05-29 11:33:30 +02:00
|
|
|
activeDot: 0
|
2023-04-14 17:13:28 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2023-05-29 11:33:30 +02:00
|
|
|
mounted() {
|
|
|
|
if (this.initialIndex != null) {
|
|
|
|
this.turnOn(this.initialIndex)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
stepCount: {
|
|
|
|
type: Number,
|
|
|
|
default: 10
|
|
|
|
},
|
|
|
|
initialIndex: {
|
|
|
|
type: Number,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2023-04-14 17:13:28 +02:00
|
|
|
methods: {
|
2023-05-29 11:33:30 +02:00
|
|
|
|
2023-04-14 17:13:28 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
turnOn: function(index) {
|
2023-05-29 11:33:30 +02:00
|
|
|
this.activeDot = index < 10 ? index + 1 : 1
|
2023-04-14 17:13:28 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|