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

Creating our new project

Navigate into a folder of your choice that will hold your project files. Don't worry—we don't need to set up servers, virtual hosts, or anything of that sort. The Vue CLI will actually set up a development server for us every time we run our project's scripts, so you can create it wherever you prefer.

The command you want to run now is vue create <name>, where <name> is the name of your project—and the folder that will be created.

We will create our new project by running the following:

> vue create vuetiful-forms

The vuetiful-forms part of the command will name the project folder. Feel free, of course, to name it as you best see fit.

Once you run this command, the Vue CLI will display a wizard that will let you configure the way you want your project to be set up:

We will go ahead and select Manually select features as we want to play around and see what options we can toggle on and off. Please be aware that the decisions we make here are not final. Anything can be added or removed later on, so don't worry!

The first screen presents us with different features and packages that we can choose:

  1. Select Babel and Lint/Formatter, which are the default two options. Later on in this book, we will add Vuex to our project manually.
  2. Hit the spacebar to select any options and the Enter key to proceed to the next screen.
  3. In the linter/formatter configuration screen, use the ESLint with error prevention only configuration.
  4. On the next screen, we will pick Lint on save. (Feel free to pick the other option if you don't like auto-linting.)
  5. For our configuration, choose to store it In dedicated config files to keep our package.json file as neat as possible.
  6. Finally, you can Save this as a preset for future projects if you would like to do so.

As a side note, please be aware that, depending on the choices you make, you may be presented with different configurations than the ones I have explained here.

The Terminal will once again go to work, and behind the scenes, it will create the project structure for your new project:

With this easy-to-follow wizard, you can easily scaffold all of your projects, but don't worry if you didn't select a particular option during this phase; the Vue CLI makes it super easy to add and remove plugins later on! Let's take a quick look at our project now.

You have been reading a chapter from
Building Forms with Vue.js
Published in: Oct 2019
Publisher: Packt
ISBN-13: 9781839213335
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