Book Image

Building Forms with Vue.js

By : Marina Mosti
Book Image

Building Forms with Vue.js

By: Marina Mosti

Overview of this book

Almost every web application and site out there handles user input in one way or another, from registration forms and log-in handling to registration and landing pages. Building Forms with Vue.js follows a step-by-step approach to help you create an efficient user interface (UI) and seamless user experience (UX) by building quick and easy-to-use forms. You’ll get off to a steady start by setting up the demo project. Next, you’ll get to grips with component composition from creating reusable form components through to implementing the custom input components. To further help you develop a convenient user input experience, the book will show you how to enhance custom inputs with v-mask. As you progress, you’ll get up to speed with using Vuelidate and Vuex to effectively integrate your forms. You’ll learn how to create forms that use global state, reactive instant user input validation and input masking, along with ensuring that they are completely schema-driven and connected to your application’s API. Every chapter builds on the concepts learned in the previous chapter, while also allowing you to skip ahead to the topics you’re most interested in. By the end of this book, you will have gained the skills you need to transform even the simplest form into a crafted user and developer experience with Vue.
Table of Contents (15 chapters)
Title Page
Dedication
Foreword

What this book covers

Chapter 1Setting up the Demo Project, will guide you through setting up the base of the project that we will be building on throughout the book. It is recommended that you work through the book in the order of the chapters, as they build on the concepts learned in the previous ones. However, the completed code for each chapter will be provided at the beginning of each in case you want to skip forward.

Chapter 2A Form in its Simplest Form, shows the basics of building a basic web form, and the process of connecting the inputs to your app's state. You will also learn about the basics of submitting the form, and using the Axios library to make asynchronous calls to the backend.

Chapter 3Creating Reusable Form Components, will teach you how to break down a form into components that can be reused throughout your application. You will understand how the v-model directive works and how the main application and form can leverage these components.

Chapter 4Input Masks with v-mask, touches upon using the v-mask library to allow for input masking to improve user experience. You will learn how to implement third-party plugins and how to incorporate them into your custom components.

Chapter 5Input Validation with Vuelidate, walks you through the process of adding Vuelidate—a powerful form validation library—to your project, creating validation rules and applying them to your form, as well as how to incorporate it into your custom components.

Chapter 6Moving to a Global State with Vuex, takes things a step further by transferring the current application's local state to a global state by leveraging the power of Vuex—the official global state management library and pattern. We will incorporate Vuelidate and our custom components into the mix.

Chapter 7Creating Schema-Driven Forms, brings all the previous concepts together and walks you through the process of understanding and creating a renderer component that allows your application to be fully schema-driven. It will react to API changes provided by a mock API, as well as provide an explanation of how to generate a fully constructed form complete with data submission to the mock backend.