Courses
Vue Foundations Vue Fullstack Vue Enterprise
Articles
Latest Topics
More
Newsletter Sponsorship Discord About
The video for this lesson is currently being updated, please read the transcript instead.
Build Your First Vue.js App > Lesson 12

Creating the cart

Let's now make it so our product items, once we click their add to cart button, actually show up in the shopping cart list.

We'll go back to our Vue instance and add a new data property called cart. It'll just be assigned an empty array, as obviously the cart will need to be empty when the page loads.

data: {
  ...
  cart: []
},

Enhance addToCart method


Back to course page

Click to load comments...

Courses
  • Vue Foundations
  • Vue Fullstack
  • Vue Enterprise
Articles
  • Latest
  • Topics
Newsletter
  • Join
  • Sponsorship
More
  • Discord
  • Vue.js jobs
  • About

Vue.js Developers © 2021. View our privacy policy .

  • RSS
  • |
  • Atom