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