Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

async data nuxt multiple requests

async asyncData ({ $axios }) {
  const [categoriesRes, articlesRes] = await Promise.all([ 
    $axios.get('/fetch/categories'),
    $axios.get('/fetch/articles'),
  ])

  return {
    categories: categoriesRes.data,
    articles: articlesRes.data,
  }
},
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #async #data #nuxt #multiple #requests
ADD COMMENT
Topic
Name
3+7 =