0
0
Fork 0

Update to use answers from VueX and not the data object.

This commit is contained in:
Oliver-Akins 2021-01-07 13:07:52 -07:00
parent 5c55f73f85
commit 81d810e951

View file

@ -105,10 +105,6 @@ export default {
},
data() {return {
visible: false,
answers: {
team_1: [ ``, ``, ``, ``, ``, ``, ``, `` ],
team_2: [ ``, ``, ``, ``, ``, ``, ``, `` ],
},
}},
computed: {
teamID() {
@ -117,6 +113,9 @@ export default {
otherTeamID() {
return this.$store.getters.otherTeamName.replace(/\s/g, `-`).toLowerCase();
},
answers() {
return this.$store.state.answer;
},
},
methods: {
answerInputHandler(answerIndex) {
@ -147,7 +146,7 @@ export default {
* value: string
* }
*/
this.answers[`team_${data.team}`].splice(data.answer - 1, 1, data.value);
this.$store.commit(`UpdateAnswer`, data);
},
},
}