I'm trying to print out the league table but the Team part is in nested object. How do I connect to that object, then make them in to table cells for team.name, team.crest? I have seen an answer here but still I can't seem to print out the nested team object inside the array.
I've tried to use the :fields prop, but it's not working. I'm stuck.
Data from console.log:
[{
draw: 1
goalDifference: 23
goalsAgainst: 14
goalsFor: 37
lost: 0
playedGames: 15
points: 43
position: 1
team: { "id": 64, "name": "Liverpool FC", "crestUrl": "http://upload.wikimedia.org/wikipedia/de/0/0a/FC_Liverpool.svg" }
}]
<template>
<b-container>
<b-table striped hover :fields="fields" :items="info">
<template v-slot:cell(name)="data">{{ data.value.team.name }}</template>
</b-table>
</b-container>
</template>
data() {
return {
fields: [
{ key: 'info.team.name', label: 'Team Name' },
],
info: [],
}
