Some changes to the logic in Rules.vue: weird behavior, TODO
[vchess.git] / client / src / components / GameList.vue
1 <template lang="pug">
2 table
3 tr
4 th Variant
5 th White
6 th Black
7 th Time control
8 th(v-if="showResult") Result
9 // TODO: show my games first (st.user.id or sid)
10 tr(v-for="g in games" @click="$emit('show-game',g)")
11 td {{ g.vname }}
12 td {{ g.players[0].name || "@nonymous" }}
13 td {{ g.players[1].name || "@nonymous" }}
14 td {{ g.timeControl }}
15 td(v-if="showResult") {{ g.score }}
16 </template>
17
18 <script>
19 export default {
20 name: "my-game-list",
21 props: ["games"],
22 computed: {
23 showResult: function() {
24 return this.games.some(g => g.score != "*");
25 },
26 },
27 };
28 </script>