rankinglist shows data from database
This commit is contained in:
parent
7613fee705
commit
2bd3d36c14
@ -22,10 +22,10 @@
|
|||||||
<q-tab-panels v-model="tab" animated swipeable class="col">
|
<q-tab-panels v-model="tab" animated swipeable class="col">
|
||||||
<q-tab-panel name="solo" class="q-pa-md fit">
|
<q-tab-panel name="solo" class="q-pa-md fit">
|
||||||
<q-list>
|
<q-list>
|
||||||
<q-card class="q-mb-md" v-for="user in users" :key="user.id">
|
<q-card class="q-mb-md" v-for="(user,index) in rankinglist" :key="user.id">
|
||||||
<q-item class="q-pr-sm ">
|
<q-item class="q-pr-sm ">
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label overline><a class="text-black" style="text-decoration: none"><span>{{user.username}}</span></a></q-item-label>
|
<q-item-label><a class="text-black" style="text-decoration: none"><span>{{index+1}}. {{user.username}}</span></a></q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section side>
|
<q-item-section side>
|
||||||
<span class="text-grey">{{user.rankingPointsSum}} Punkte </span>
|
<span class="text-grey">{{user.rankingPointsSum}} Punkte </span>
|
||||||
@ -69,24 +69,19 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tab: 'solo',
|
tab: 'solo',
|
||||||
rankinglist: [],
|
rankinglist: []
|
||||||
users: [{
|
|
||||||
username: "CacherA", id: "123", rankingPointsSum: "15"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
username: "CacherB", id: "124", rankingPointsSum: "20"
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created: function() {
|
created: function() {
|
||||||
console.log("created(): " + this.rankinglist);
|
console.log("created(): " + this.rankinglist);
|
||||||
// this.fetchRankinglist();
|
this.fetchRankinglist();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchRankinglist() {
|
fetchRankinglist() {
|
||||||
this.$axios.get('http://localhost:8080/api/getRankingList')
|
this.$axios.get('http://localhost:8080/api/getRankingList')
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log("Rankinglist: " + this.rankinglist);
|
console.log("Rankinglist: ");
|
||||||
|
console.log(response.data);
|
||||||
this.rankinglist = response.data;
|
this.rankinglist = response.data;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user