Work on main hall
[vchess.git] / client / src / components / GameList.vue
1 <template lang="pug">
2 table
3 tr
4 th Variant
5 th Players names
6 th Cadence
7 th(v-if="showResult") Result
8 th(v-else) Moves count
9 tr(v-for="g in games" @click="$emit('show-game',g)")
10 td {{ g.vname }}
11 td
12 span(v-for="p in g.players") {{ p.name }}
13 td {{ g.mainTime }} + {{ g.increment }}
14 td(v-if="showResult") {{ g.score }}
15 td(v-else) {{ g.movesCount }}
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.length > 0 && this.games[0].score != "*";
25 },
26 },
27 };
28 </script>