Chapter 4. Forms and inputs

 

This chapter covers

  • Binding values to the DOM
  • Using text binding
  • Modifiers

Our application has evolved substantially since chapter 1. We’ve created items and allowed users to add items to a cart. We now need a way for our customers to check out and enter their information. Let’s add input forms to our application so the customer can enter their address and billing information into the app. Then we need to save this information in our app for later use.

To accomplish our goal, we must bind the form data to our model in our application. The v-model directive was made for this use case.

Definition

The v-model directive creates a two-way data binding between form or text area inputs and the template. This assures data in our application model will always be in sync with our UI.

4.1. Using v-model binding

 
 
 

4.2. A look at value binding

 
 
 
 

4.3. Learning modifiers with the application

 
 
 

Exercise

 
 
 

Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest