+ <tr v-for="p in sortedPlayers" v-if="p.nom!=''">
+ <td>{{ p.rank }}</td>
<td>{{ p.prenom }} {{ p.nom }}</td>
<td>{{ p.prenom }} {{ p.nom }}</td>
- <td>{{ p.score }}</td>
<td>{{ p.pdt }}</td>
<td>{{ p.pdt }}</td>
+ <td>{{ p.session }}</td>
</tr>
</table>
</div>
`,
</tr>
</table>
</div>
`,
- computed: {
+ computed: { //TODO: first sort on score, then on Pdt (and reciprocally) --> function add fraction relative Pdt / score (compute min max first, take care of 0 case)
sortedPlayers: function() {
sortedPlayers: function() {
- let sortFunc = this.sortMethod == "score"
- ? this.sortByScore
- : this.sortByPdt;
- return this.players
- .map( p => { return p; }) //to not alter original array
+ let sortFunc = this.sortMethod == "pdt"
+ ? this.sortByPdt
+ : this.sortBySession;
+ let res = this.players
+ .map( p => { return Object.assign({}, p); }) //to not alter original array
.sort(sortFunc);
.sort(sortFunc);
+ // Add rank information (taking care of ex-aequos)