Design the Front-end, Load All Data, and Add a Footer/Header
Learn how to load all data, add a footer/header, and display top categories and products for the home page.
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:
- Fetch all the categories
- Fetch all the products
Get hands-on with 1400+ tech skills courses.