Vue Hooks Building Forms With Vue Composition API

vuejs-hooks-form

Vue Hooks Building forms with the Hook Form allows you to easily create HTML forms using the Vue Configuration API.

vue form builder drag and drop, vue dynamic form builder, vue 3 form builder, vuetify form builder, vue form example, form builder github

How to make use of it:

Install and download:

# Yarn
$ yarn add vue-hooks-form
# NPM
$ npm i vue-hooks-form --save

1. Import the Hooks Form module.

import { useForm } from 'vue-hooks-form'

2. In your application template:

<template>
  <form @submit="onSubmit">
    <label>Username</label>
    <input v-model="username.value" :ref="username.ref" />
    <p v-if="username.error">{{ username.error.message }}</p>
    <label>Password</label>
    <input v-model="password.value" :ref="password.ref" type="password" />
    <p v-if="password.error">{{ password.error.message }}</p>
    <button type="submit">submit</button>
  </form>
</template>

3. Setup your form.

export default {
  setup() {
    const { useField, handleSubmit } = useForm({
      defaultValues: {},
    })
    const username = useField('username', {
      rule: { required: true },
    })
    const password = useField('password', {
      rule: {
        required: true,
        min: 6,
        max: 10,
      },
    })
    const onSubmit = (data) => console.log(data)
    return {
      username,
      password,
      onSubmit: handleSubmit(onSubmit),
    }
  },
}

Form Builder With Vue Composition API, Vue Hooks Form Plugin/Github


See Demo And Download

Official Website(beizhedenglong): Click Here

This superior jQuery/javascript plugin is developed by beizhedenglong. For extra Advanced Usages, please go to the official website.