I am attempting to utilize a method within a v-for loop to make an API call and load an object based on a UID.
Below is the structure of my method:
methods: {
async getTodo(uid) {
const data = await axios.get(
"https://jsonplaceholder.typicode.com/todos/" + uid
);
return data;
}
}
I thought I could simply include the method inline like this:
{{ getTodo(2) }}
However, all it returns is [object Promise]. I must have misunderstood either the use of methods in this context or the implementation of the async call within the method. If anyone can provide clarification on what might be going wrong here, it would be greatly appreciated.