projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Step toward a one-page application
[vchess.git]
/
public
/
javascripts
/
components
/
gameList.js
diff --git
a/public/javascripts/components/gameList.js
b/public/javascripts/components/gameList.js
index
fcbb39a
..
9b66982
100644
(file)
--- a/
public/javascripts/components/gameList.js
+++ b/
public/javascripts/components/gameList.js
@@
-1,18
+1,23
@@
Vue.component("my-game-list", {
props: ["games"],
computed: {
Vue.component("my-game-list", {
props: ["games"],
computed: {
+ showVariant: function() {
+ return this.games.length > 0 && !!this.games[0].vname;
+ },
showResult: function() {
showResult: function() {
- this.games.length > 0 && this.games[0].score != "*";
+
return
this.games.length > 0 && this.games[0].score != "*";
},
},
template: `
<table>
<tr>
},
},
template: `
<table>
<tr>
+ <th v-if="showVariant">Variant</th>
<th>Players names</th>
<th>Cadence</th>
<th>Players names</th>
<th>Cadence</th>
- <th v-if="showResult">
+ <th v-if="showResult">
Result</th>
</tr>
<tr v-for="g in games" @click="$emit('show-game',g)">
</tr>
<tr v-for="g in games" @click="$emit('show-game',g)">
+ <td v-if="showVariant">{{ g.vname }}</td>
<td>
<span v-for="p in g.players">{{ p.name }}</span>
</td>
<td>
<span v-for="p in g.players">{{ p.name }}</span>
</td>