Design the Front-end, Load All Data, and Add a Footer/Header

Fetch all the products and categories

As we’ll use products and categories a lot, it makes sense to store them all when we load the application the first time. This will help us save API calls later. So, let’s implement this functionality next. Once we have the data, we’ll make it available for all viewing.

First, go to App.vue and create the fetchData() method.

The fetchData() method will perform the following:

  1. Fetch all the categories
  2. Fetch all the products

Get hands-on with 1200+ tech skills courses.