Learn Vue JS course Learn Javascript and Vue JS Learn VueJS course Learn VueJS Tutorial

The Complete Guide to Data Fetching in Nuxt

A Brief Overview of Other Nuxt useFetch Configuration Options thumbnail image

Get access to the most comprehensive Vue.js video library in the world. Over 300 video lessons including the newest Vue 3 features.

A Brief Overview of Other Nuxt useFetch Configuration Options

In this lesson, we quickly go over the rest of the useFetch options available that we have not covered in the course so far.

  • server:false - makes the request ONLY on the client side (even on page load)
  • immediate: false - keeps useFetch from immediately making the request, meaning you’ll have to call execute yourself
  • default - sets the default value of the data for when the actual response data isn’t available
  • dedupe - allows you to configure how to handle overlapping or duplicated requests

All of these options are available for useFetch and useAsyncData.

useFetch has a few more that are essentially passed on to the underlying $fetch function (like method, baseURL, and headers.

Links