Fetching Article Data using Vuex

Learn how to fetch data of the article from an API.

In this lesson, we are going to fetch the article data from the API mentioned in the api.js file. After fetching the data, we are going to feed the data into the ArticlePreview component from Home.vue to display the dynamic article list. All the fetching operations will be completed using the Vuex mechanism.

First, we need to create a new Vuex module called article.js inside the ./modules folder.

Inside the article.js file, we can use the code from the following code snippet:

Get hands-on with 1300+ tech skills courses.