Add getters for the team names.
This commit is contained in:
parent
299cc99c88
commit
40fcf179d7
1 changed files with 14 additions and 0 deletions
|
|
@ -36,6 +36,20 @@ export default new Vuex.Store({
|
|||
id: null,
|
||||
players: [],
|
||||
},
|
||||
getters: {
|
||||
teamName(state) {
|
||||
if (state.team > 0) {
|
||||
return state[`team_${state.team}`].name;
|
||||
};
|
||||
return ``;
|
||||
},
|
||||
otherTeamName(state) {
|
||||
if (state.team > 0) {
|
||||
return state[`team_${3 - state.team}`].name;
|
||||
};
|
||||
return ``;
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
},
|
||||
actions: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue