Fix challenge persistence issue
[vchess.git] / client / src / components / GameList.vue
CommitLineData
85e5b5c1
BA
1<template lang="pug">
2table
3 tr
9d58ef95 4 th Variant
85e5b5c1
BA
5 th Players names
6 th Cadence
7 th(v-if="showResult") Result
9d58ef95 8 th(v-else) Moves count
85e5b5c1 9 tr(v-for="g in games" @click="$emit('show-game',g)")
9d58ef95 10 td {{ g.vname }}
85e5b5c1
BA
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 }}
9d58ef95 15 td(v-else) {{ g.movesCount }}
85e5b5c1
BA
16</template>
17
18<script>
19export default {
20 name: "my-game-list",
21 props: ["games"],
22 computed: {
85e5b5c1
BA
23 showResult: function() {
24 return this.games.length > 0 && this.games[0].score != "*";
25 },
26 },
27};
28</script>