Nuxt.js' asyncData is a way of blocking a specific page render, for data fetching and then proceed by returning the computed data.
Looking like this
async asyncData({ params, $http }) {
const post = await $http.$get(`https://api.nuxtjs.dev/posts/${params.id}`)
return { post }
}
It is an alternative to the fetch()
hook. More details on the differences between the two can be found here: https://nuxtjs.org/blog/understanding-how-fetch-works-in-nuxt-2-12/