Created
February 7, 2025 17:50
-
-
Save lovemycodesnippets/46c08b3196971f14c15186a48a8b9764 to your computer and use it in GitHub Desktop.
From the article "Building a Quiz App with Nuxt and Xata"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup> | |
… | |
const reset = () => { | |
totalCorrect.value = 0; | |
questionsAnswered.value = 0; | |
}; | |
</script> | |
<template> | |
<main> | |
<div class="ctr"> | |
<Questions | |
v-if="questionsAnswered < questions.length" | |
:questions="questions" | |
:answers="answers" | |
:questionsAnswered="questionsAnswered" | |
@question-answered="questionAnswered" /> | |
<Result v-else /> | |
<button | |
type="button" | |
class="reset-btn" | |
v-if="questionsAnswered === questions.length" | |
@click.prevent="reset"> | |
Reset | |
</button> | |
</div> | |
<Footer /> | |
</main> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment