1
1
<template >
2
- <v-card color =" #ddf9fd" >
3
- <span >GameId {{ game.gameId }}</span
4
- ><br />
5
- <span >Clicks {{ game.clicks }}</span >
6
- <div class =" game-player-info" >
7
- <div v-for =" (info, index) in playerScores" :key =" index" >
8
- {{ info.player }} ({{ info.score }})
9
- </div >
10
- </div >
11
- <v-btn @click =" resume()" >Resume</v-btn >
2
+ <v-card >
3
+ <v-layout column align-space-around justify-center >
4
+ <v-layout row align-center justify-center fill-height >
5
+ <v-layout
6
+ v-for =" (info, index) in playerScores"
7
+ :key =" index"
8
+ column
9
+ align-center
10
+ justify-center
11
+ :class =" { currentPlayer: game.currentPlayerIndex === index }"
12
+ >
13
+ <img
14
+ style =" width : 36px ; height : 36px "
15
+ :src =" users[index].picture"
16
+ v-if =" users[index] && users[index].picture"
17
+ />
18
+ <v-icon large v-else >help</v-icon >
19
+ <span >{{ info.player }}</span >
20
+ <span >{{ info.score }}</span >
21
+ </v-layout >
22
+ </v-layout >
23
+ <v-tooltip bottom >
24
+ <template v-slot :activator =" { on } " >
25
+ <v-btn @click =" resume()" v-on =" on" >Resume</v-btn >
26
+ </template >
27
+ <span >GameId {{ game.gameId }}</span >
28
+ </v-tooltip >
29
+ </v-layout >
12
30
</v-card >
13
31
</template >
14
32
<script >
33
+ import { mapState } from " vuex" ;
34
+
15
35
export default {
16
36
name: " IncompleteGame" ,
17
37
props: [" game" ],
@@ -32,7 +52,14 @@ export default {
32
52
},
33
53
scores () {
34
54
return this .game .scores .split (" ," );
35
- }
55
+ },
56
+ ... mapState (" lobby" , {
57
+ users (state ) {
58
+ return this .game .players .map (
59
+ player => state .onlineUsers [player .playerName ]
60
+ );
61
+ }
62
+ })
36
63
}
37
64
};
38
65
</script >
0 commit comments