Replacing dummy items
Regarding the response object created by Vue Resource, the body
property contains the data we want to work with now.
We can see that these are an array of product objects, so let's get those into our product array.
The first thing we'll do is delete the dummy items, as we won't need those anymore.
new Vue({
el: "#app",
data: {
total: 0,
products: [],
cart: [],
search: ""
},
methods: { ... },
filters: { ... }
});
Click to load comments...