0
0
Fork 0

Add answers and mutations for answers

This commit is contained in:
Oliver-Akins 2021-01-07 13:22:53 -07:00
parent 81d810e951
commit 07ad42280d

View file

@ -46,6 +46,10 @@ export default new Vuex.Store({
questions: [],
game_code: null,
players: [],
answers: {
team_1: [ ``, ``, ``, ``, ``, ``, ``, `` ],
team_2: [ ``, ``, ``, ``, ``, ``, ``, `` ],
}
},
getters: {
teamName(state) {
@ -112,6 +116,12 @@ export default new Vuex.Store({
appendToHand(state, 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: {
},