🚸 - Reset button

Can only click once on the button when it has been reset
This commit is contained in:
RemiSaurel
2022-08-29 14:30:57 +02:00
parent 98b759abcf
commit c9386b2e67
+7 -4
View File
@@ -34,10 +34,10 @@
<br> <br>
Total sessions: {{ this.nbSessions }} Total sessions: {{ this.nbSessions }}
<br> <br>
<span id="hint">(from last session)</span> <span id="hint">(last + current session)</span>
<div class="center"> <div class="center">
<button @click="resetStats" class="btn" id="reset"> <button @click="resetStats" class="btn" id="reset-stats" :disabled="resetDone">
🔁 Reset 🔁 Reset last session
</button> </button>
<br> <br>
<button class="btn" id="see-words" @click="displayWord = true"> <button class="btn" id="see-words" @click="displayWord = true">
@@ -62,6 +62,7 @@ export default {
definition: '', definition: '',
}, },
displayWord: true, displayWord: true,
resetDone: false
}; };
}, },
methods: { methods: {
@@ -141,7 +142,9 @@ export default {
}); });
}, },
resetStats() { resetStats() {
this.resetDone = true;
this.$store.commit('resetStats'); this.$store.commit('resetStats');
console.log(this.resetDone)
}, },
}, },
mounted() { mounted() {
@@ -230,7 +233,7 @@ export default {
font-weight: lighter; font-weight: lighter;
} }
#reset { #reset-stats {
margin-top: 16px; margin-top: 16px;
} }