Currently working on my nuxtjs3 project, where I am extracting data from an API.
Specifically using jsonPlaceholder for this task. Extracting data from a single object is not a problem:
const { data: useFetchOnly } = await useFetch('https://jsonplaceholder.typicode.com/todos/1', {
pick: ['title']
})
console.log({useFetchOnly})
However, when attempting to extract data from an array of objects, I'm facing some challenges. My attempt so far has been unsuccessful:
const { data: useFetchArray } = await useFetch('https://jsonplaceholder.typicode.com/todos/', {
pick: ['title']
})
console.log({useFetchArray})
Any suggestions on how to resolve this issue?
The documentation I've come across hasn't been very helpful in this particular scenario: LINK