adds simple cookie to store active player_id
This commit is contained in:
@@ -75,16 +75,11 @@
|
||||
data () {
|
||||
return {
|
||||
app_state: store.state,
|
||||
player: {
|
||||
name: "Groupe",
|
||||
wealth: [100,240,145000,134],
|
||||
debt: 0,
|
||||
},
|
||||
player_list: [
|
||||
{id: 0, name: "Groupe"},
|
||||
{id: 1, name: "Lomion"},
|
||||
{id: 4, name: "Oilosse"},
|
||||
{id: 3, name: "Fefi"},
|
||||
{id: 0, name: "Groupe", wealth: [0,0,0,0], debt: 0},
|
||||
{id: 1, name: "Lomion", wealth: [0,0,0,0], debt: 0},
|
||||
{id: 4, name: "Oilosse", wealth: [0,0,0,0], debt: 0},
|
||||
{id: 3, name: "Fefi", wealth: [0,0,0,0], debt: 0},
|
||||
],
|
||||
show_dropdown: false,
|
||||
edit_wealth: false,
|
||||
@@ -92,6 +87,12 @@
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
player () {
|
||||
const id = this.app_state.player_id;
|
||||
const idx = this.player_list.findIndex(p => p.id == id);
|
||||
console.log(id, idx);
|
||||
return this.player_list[idx];
|
||||
},
|
||||
name () {
|
||||
return this.player.name;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user