Generate and Show all OTPs directly on the main view - Complete #153

This commit is contained in:
Bubka
2023-04-14 17:13:28 +02:00
parent 4f81b30fcd
commit b8c810f885
16 changed files with 504 additions and 36 deletions

View File

@ -0,0 +1,38 @@
<template>
<ul class="dots">
<li v-for="n in 10" :key="n"></li>
</ul>
</template>
<script>
export default {
name: 'Dots',
data() {
return {
}
},
methods: {
/**
*
*/
turnOn: function(index) {
const dots = this.$el.querySelectorAll('[data-is-active]')
dots.forEach((dot) => {
dot.removeAttribute('data-is-active')
});
if (index < 10) {
const dot = this.$el.querySelector('.dots li:nth-child(' + (index + 1) + ')')
if (dot) {
dot.setAttribute('data-is-active', true)
}
}
else {
this.$el.querySelector('.dots li:nth-child(1)').setAttribute('data-is-active', true)
}
},
},
}
</script>