I am currently working on integrating the API breakpoints in my child component.
These components are designed for my football web application.
The breakpoints are sourced from: api-football
My challenge lies in passing multiple prop values into a component.
During debugging, I noticed that only the second prop (league) is being read in the parent component.
Encountered Errors:
If you have some spare time, feel free to provide a code review. I am currently learning Vue.
Teams.vue (parent):
<template>
<main id="Home-page">
<UserPanel/>
<Transition name="bounce">
<h1 v-if="headerShow" class="welcome-header">
Team statistics
</h1>
</Transition>
...
</div>
</div>
</main>
</template>
...
})
},
},
watch: {
selectedLeague: function (value) {
this.teams.length = 0;
}
}).catch(function (error) {
console.error(error);
});
},
selectedTeam: function (value) {
console.log(value)
}
},
}
</script>
<style>
/* styles go here */
</style>
TeamStatistics.vue (child):
<template>
<div class="popup">
...
}
}
</script>
<style scoped>
/* styles go here */
</style>
Example response:
let response = {
"league": {
"id": 39,
"name": "Premier League",
"country": "England",
"logo": "https://media.api-sports.io/football/leagues/39.png",
"flag": "https://media.api-sports.io/flags/gb.svg",
"season": 2022
},
"team": {
"id": 33,
"name": "Manchester United",
"logo": "https://media.api-sports.io/football/teams/33.png"
},
"form": "LLWWWWLWDWDWLW",
...