0👍
From your screenshot it looks like you have an array of objects being returned. You would not be able to get .name
because it is an array not an object being returned. If you want just the country name you might need to display it as:
{{ border[0].name }}
- [Vuejs]-How remove active class from router-link when :to property get false value?
- [Vuejs]-How to auth the user in vue 3?
0👍
I found a solution:
function search(nameKey, myArray) {
for (var i = 0; i < myArray.length; i++) {
if (myArray[i].alpha3Code === nameKey) {
return myArray[i];
}
}
}
This worked perfectly after putting countryLookup(border).name I don’t think I was searching the array properly
Source:stackexchange.com