<template lang="pug">
table
tr
- th(v-if="showVariant") Variant
+ th Variant
th Players names
th Cadence
th(v-if="showResult") Result
+ th(v-else) Moves count
tr(v-for="g in games" @click="$emit('show-game',g)")
- td(v-if="showVariant") {{ g.vname }}
+ td {{ g.vname }}
td
span(v-for="p in g.players") {{ p.name }}
td {{ g.mainTime }} + {{ g.increment }}
td(v-if="showResult") {{ g.score }}
+ td(v-else) {{ g.movesCount }}
</template>
<script>
name: "my-game-list",
props: ["games"],
computed: {
- showVariant: function() {
- return this.games.length > 0 && !!this.games[0].vname;
- },
showResult: function() {
return this.games.length > 0 && this.games[0].score != "*";
},