Nuxt useFetch
up:: Nuxt ⚐ This uses JavaScript parameter desctructuring.
Note: You then have to use the data in a template. Logging it to the console to check is only going to give you a weird string.
This is because it is implicitly a reference (which I guess is the same as a stateful variable?). Use it like this
Or, if we don’t want it to be a proxy you can use toRaw
.
useLazyFetch
useFetch
freezes the application until the data is loaded. useLazyFetch
shows a loading screen instead.