1 Vue
.component("my-challenge-list", {
4 showVariant: function() {
5 this.challenges
.length
> 0 && !!this.challenges
[0].variant
;
7 showNbPlayers: function() {
8 this.challenges
.length
> 0 && !!this.challenges
[0].nbPlayers
;
14 <th v-if="showVariant">Variant</th>
18 <th v-if="showNbPlayers">Number of players</th>
20 <tr v-for="c in challenges" @click="$emit('click-challenge',c)">
21 <td v-if="showVariant">{{ c.variant }}</td>
22 <td>{{ c.from.name }}</td>
24 <span v-for="p in c.to">{{ p.name }}</span>
26 <td>{{ c.mainTime }} + {{ c.increment }}</td>
27 <td v-if="showNbPlayers">{{ c.nbPlayers }}</td>
33 // TODO: challenge format from/to ou uid/players ............