Nuxt 3 is coming.. Discover more about it here!

Docs Examples Resources Blog Video courses
  • English
  • Français
  • Routing
    • Hello World
    • Active Link Classes
    • Dynamic Pages
    • Nested Pages
  • Data Fetching
    • asyncData Hook
    • fetch Hook
  • Assets Management
  • Transitions
  • Seo
  • Loading
  • Miscellaneous
  • Middlewares
  • Plugins
  • Modules
  • English
  • Français
  • Routing
    • Hello World
    • Active Link Classes
    • Dynamic Pages
    • Nested Pages
  • Data Fetching
    • asyncData Hook
    • fetch Hook
  • Assets Management
  • Transitions
  • Seo
  • Loading
  • Miscellaneous
  • Middlewares
  • Plugins
  • Modules

asyncData Hook

In this example we use asyncData to fetch our data from our API.


In this example:

pages/index.vue and pages/posts/_id use the asyncData hook and the $http module to fetch our list of mountains from our API.

Learn more about the http module .
Learn more about the asyncData hook the Features book in the Data Fetching chapter.
Loading Sandbox...
Edit this page on GitHub Updated at Mon, Jul 12, 2021

Routing Nested Pages
Data Fetching fetch Hook

Partners

  • Netlify
  • Google Chrome
  • Vercel
  • Strapi
  • Swell
  • Ship Shape
  • Layer0
  • Storyblok
Support Us
A landscape image A landscape image

Discover

  • Our team
  • Design Kit
  • Contact us

Help

  • Resources
  • Chat with us
  • Contribution guide

Support

  • Sustainability
  • Training

Settings

Subscribe to our newsletter

The latest news, articles, and resources, sent to your inbox monthly.

NuxtJS is an open source framework under MIT license.