Binding the Shopping Cart Collection to the App Component
Understand how to initialize a shopping cart collection with TypeScript interfaces and classes, then bind it to a Vue app component. This lesson shows how to manage and pass data between components for maintaining shopping cart state.
We'll cover the following...
We'll cover the following...
Initializing the shopping cart collection
Let’s start our application by updating our App.vue component. The App component will just be the entry point to our application and will hold the collection of items that are in our shopping cart. For the purposes of this application, we will just create a static set of items in a file named CartItems.ts as follows:
-
We have ...