I'm currently utilizing VueJS along with a REST API and axios to retrieve the list of countries, then showcasing them in card format on the webpage. However, I am facing a challenge in creating a history list that captures the last 5 countries clicked by the user.
Although I have successfully logged all the countries displayed on the page, the issue lies in logging the specific country that is clicked by the user.
You can find the component code here
<strong class="card-text" v-on:click="handleClick">{{
country.name
}}</strong>
handleClick() {
//console.log("[response]", JSON.stringify(this.countries));
},