Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Forms with Vue.js

You're reading from   Building Forms with Vue.js Patterns for building and scaling complex forms with great UX

Arrow left icon
Product type Paperback
Published in Oct 2019
Publisher Packt
ISBN-13 9781839213335
Length 108 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Marina Mosti Hernandez Mosti Marina Mosti Hernandez Mosti
Author Profile Icon Marina Mosti Hernandez Mosti
Marina Mosti Hernandez Mosti
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Setting up the Demo Project FREE CHAPTER 2. A Form in its Simplest Form 3. Creating Reusable Form Components 4. Input Masks with v-mask 5. Input Validation with Vuelidate 6. Moving to a Global State with Vuex 7. Creating Schema-Driven Forms 8. Other Books You May Enjoy

Bringing in Axios

The next step in our form is to actually have the form send the user's data to our servers. For the sake of example, the data is not going to be actually stored anywhere, but we will look at the steps of creating the POST call that most forms will use for transferring the data to an API or server endpoint.

Axios is a fantastic and popular library for sending and receiving data from servers. I personally recommend it as a go-to whenever you need to make any HTTP calls from your Vue apps. You can find the official GitHub page here: github.com/axios/axios.

Follow the next set of steps to get Axios ready on your project:

  1. Fire up your Terminal and run the following command:
> npm install axios
  1. We are going to need an API endpoint to make our calls to. Since we don't have any servers at hand—and to keep things really simple—we are...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime