Добавил счет за сессию

This commit is contained in:
2021-03-31 12:49:53 +03:00
parent d72a0d618c
commit 4f9d98d13b
4 changed files with 103 additions and 7 deletions

View File

@@ -14,7 +14,8 @@
</transition>
</div>
</div>
<square-loader v-else :color="'#f3f3f3'" class="loader" />
<Score :score="score" />
<square-loader v-if="card === null" :color="'#f3f3f3'" class="loader" />
</div>
</template>
@@ -22,6 +23,7 @@
import axios from 'axios'
import List from './List.vue'
import Result from './Result.vue'
import Score from './Score.vue'
import SquareLoader from 'vue-spinner/src/SquareLoader.vue'
@@ -30,8 +32,12 @@ export default {
components: {
List,
Result,
Score,
SquareLoader
},
props: {
score: Object
},
data() {
return {
options: null,
@@ -65,6 +71,11 @@ export default {
let innerThis = this
setTimeout(function() {
innerThis.showResult = true
if (innerThis.correctAnswer) {
innerThis.score.right++
} else {
innerThis.score.wrong++
}
}, 805)
this.oldCard = this.card
axios