Total-numbers
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
<div v-if="highscore.length > 0">
|
||||
<h3>Highscore</h3>
|
||||
<ol>
|
||||
<li v-for="person in highscore">
|
||||
{{ person.name }} - {{ person.wins.length }}
|
||||
</li>
|
||||
<li v-for="person in highscore">{{ person.name }} - {{ person.wins.length }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</template>
|
||||
@@ -15,10 +13,11 @@ export default {
|
||||
return { highscore: [] };
|
||||
},
|
||||
async mounted() {
|
||||
let _response = await fetch(
|
||||
"/api/highscore/statistics"
|
||||
);
|
||||
let _response = await fetch("/api/highscore/statistics");
|
||||
let response = await _response.json();
|
||||
response.sort((a, b) => {
|
||||
return a.wins.length > b.wins.length ? 1 : -1;
|
||||
});
|
||||
this.highscore = response;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user