-
Nuxt.js
Discontinued Nuxt is an intuitive and extendable way to create type-safe, performant and production-grade full-stack web apps and websites with Vue 3. [Moved to: https://github.com/nuxt/nuxt]
Let's look at how we can implement the same pattern in Nuxt when using the composition api.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
Since we'll be using the Vue.js composition API we'll install the Nuxt plugin that will allow us to use the Vue 3 Composition API with Nuxt-specific features.
-
A common pattern when using Axios in Vue.js apps, is to create a custom axios instance with interceptors attached in order to handle things (like e.g authentication and error reporting) globally. We then use that instance in our API functions that are grouped inside files and/or folders depending on the business context. Finally we import the API functions inside our components in order to fetch data.