Vue Static Json

Posted on  by admin

Modified2 years, 6 months ago. I am creating a Vue JS app which will display a list of products that when clicked on will link through to a dynamic product by its ID (passed via Vue Router params).

This bit works fine but what I need to do is once on that dynamic route, display all the data for that product by its ID.

#1 Create the Project with the Vue CLI

I'm still pretty new to Vue and confused by what approach to take. I don't think I need axios as this won't be an online app so no access to APIs.

I also don't know if I need to go as far as using vuex. At present I'm trying to use a simple method to grab the data from my JSON file by the ID passed through the routes parameters.

Here's what I have so far.. Slider.vue - this component is called in Views/Products.vue and is what links through to each single product .