0%

Book Description

Learn how to build dynamic schema-driven forms with Vue from scratch

Key Features

  • Understand the basics of form component composition
  • Scale and integrate your forms with libraries such as Vuex and Vuelidate
  • Convert any form into a self-generated schema-driven app

Book Description

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.

What you will learn

  • Learn all about the basics of creating reusable form components with the Vue framework
  • Understand v-model and how it plays a role in form creation
  • Create forms that are completely powered and generated by a schema, either locally or from an API endpoint
  • Understand how Vuelidate allows for easy declarative validation of all your form's inputs with Vue's reactivity system
  • Connect your application with a Vuex-powered global state management
  • Use the v-mask library to enhance your inputs and improve user experience (UX)

Who this book is for

If you are a developer with basic Vue experience who wants to enhance your forms, then this book is for you. No previous experience with any of the libraries used in the book is required.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Building Forms with Vue.js
  3. Dedication
  4. About Packt
    1. Why subscribe?
  5. Foreword
  6. Contributors
    1. About the author
    2. About the reviewers
    3. Packt is searching for authors like you
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Code in Action
      4. Conventions used
    4. Get in touch
      1. Reviews
  8. Setting up the Demo Project
    1. Technical requirements
    2. Installing Vue CLI onto our computer
    3. Creating our new project
    4. A quick look at the project structure
    5. Summary
  9. A Form in its Simplest Form
    1. Technical requirements
    2. Getting started using Bootstrap
    3. Actually writing some code
    4. Binding the inputs to local state
    5. Submitting the form's data
    6. Bringing in Axios
    7. Summary
  10. Creating Reusable Form Components
    1. Technical requirements
    2. Breaking down the form into components
    3. Understanding v-model in custom components
    4. Implementing a custom input component
    5. One more time – with dropdowns!
    6. Summary
  11. Input Masks with v-mask
    1. Technical requirements
    2. Installing the v-mask library
    3. Exploring the v-mask directive
    4. Enhancing our custom inputs
    5. Summary
  12. Input Validation with Vuelidate
    1. Technical requirements
    2. Installing dependencies
    3. Creating validation rules
    4. Moving validation into our custom inputs
    5. Adding the final touches
    6. Summary
  13. Moving to a Global State with Vuex
    1. Technical requirements
    2. Adding Vuex to our project
    3. Creating the mock API endpoint
    4. Creating the global state
    5. Adding some mutations to our store
    6. Lights, Vue, actions!
    7. Vuelidate and Vuex
    8. Summary 
  14. Creating Schema-Driven Forms
    1. Technical requirements
    2. Exploring the starter kit
    3. Preparing the schema
      1. Loading the schema and creating a Renderer component
    4. Dynamically binding the user's data
    5. Creating a mock API
    6. Loading the new API into the app
    7. Translating the API into a working schema
    8. Summary
  15. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think
44.204.117.57