Add answers and mutations for answers
This commit is contained in:
parent
81d810e951
commit
07ad42280d
1 changed files with 10 additions and 0 deletions
|
|
@ -46,6 +46,10 @@ export default new Vuex.Store({
|
||||||
questions: [],
|
questions: [],
|
||||||
game_code: null,
|
game_code: null,
|
||||||
players: [],
|
players: [],
|
||||||
|
answers: {
|
||||||
|
team_1: [ ``, ``, ``, ``, ``, ``, ``, `` ],
|
||||||
|
team_2: [ ``, ``, ``, ``, ``, ``, ``, `` ],
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
teamName(state) {
|
teamName(state) {
|
||||||
|
|
@ -112,6 +116,12 @@ export default new Vuex.Store({
|
||||||
appendToHand(state, questions) {
|
appendToHand(state, questions) {
|
||||||
state.questions.push(...questions);
|
state.questions.push(...questions);
|
||||||
},
|
},
|
||||||
|
updateAnswer(state, data) {
|
||||||
|
state.answers[`team_${data.team}`].splice(data.answer - 1, 1, data.value)
|
||||||
|
},
|
||||||
|
setAnswers(state, data) {
|
||||||
|
state.answers = Vue.reactive(data);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue