| 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 | tr(v-for="g in games" @click="$emit('show-game',g)") |
| 10 | td {{ g.vname }} |
| 11 | td {{ g.players[0] }} |
| 12 | td {{ g.players[1] }} |
| 13 | td {{ g.timeControl }} |
| 14 | td(v-if="showResult") {{ g.score }} |
| 15 | </template> |
| 16 | |
| 17 | <script> |
| 18 | export default { |
| 19 | name: "my-game-list", |
| 20 | props: ["games"], |
| 21 | computed: { |
| 22 | showResult: function() { |
| 23 | return this.games.length > 0 && this.games[0].score != "*"; |
| 24 | }, |
| 25 | }, |
| 26 | }; |
| 27 | </script> |