[Vuejs]-What's the best way to get/access data infos using nuxt and a personal backend API?

0👍

if you have axios installed in nuxt project, you can see below sample to retrieve api response and display.

<template>
 <div>
 {{api_response}}
 </div>
</template>

<script>
  export default {
       async asyncData(app) {
     const response = await app.$axios.get(`/api/sample`)
    return { api_response: response.data}
  },
    data: () => ({

    }),


  }
</script>

but i think you need to learn more to implement api related activities, in that case read more from here.

Leave a comment