refactor(client): remove useless questions getters
parent
7a040bdbe6
commit
7c9fa6ae1d
Binary file not shown.
Before Width: | Height: | Size: 6.7 KiB |
|
@ -22,15 +22,17 @@ export default Vue.extend({
|
|||
name: 'Quiz',
|
||||
props: {},
|
||||
computed: {
|
||||
...mapGetters('schools', ['schools']),
|
||||
...mapGetters('questions', [
|
||||
...mapState('questions', [
|
||||
'questions',
|
||||
'index',
|
||||
'score',
|
||||
]),
|
||||
...mapGetters('questions', [
|
||||
'currentQuestion',
|
||||
'checkAnswer',
|
||||
'isLastQuestion',
|
||||
]),
|
||||
...mapGetters('schools', ['schools']),
|
||||
},
|
||||
methods: {
|
||||
answer(answer: number): void {
|
||||
|
|
|
@ -21,15 +21,6 @@ IStoreQuestions,
|
|||
questions: [],
|
||||
},
|
||||
getters: {
|
||||
index(state): number {
|
||||
return state.index;
|
||||
},
|
||||
score(state): number {
|
||||
return state.score;
|
||||
},
|
||||
questions(state): IQuestion[] {
|
||||
return state.questions;
|
||||
},
|
||||
currentQuestion(state): IQuestion | {} {
|
||||
return state.questions.length ? state.questions[state.index] : {};
|
||||
},
|
||||
|
|
|
@ -21,7 +21,11 @@ export default Vue.extend({
|
|||
ScoreScreen,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('questions', ['index', 'questions', 'score']),
|
||||
...mapState('questions', [
|
||||
'questions',
|
||||
'index',
|
||||
'score',
|
||||
]),
|
||||
},
|
||||
created(): void {
|
||||
if (this.index === 0) {
|
||||
|
|
Loading…
Reference in New Issue