Vue Use Form Vue Use Form Save

Vue Composition API for validating form.

Project README

vue-use-form

Inspired by react-hook-form, if you love react-hook-form usage, come on and try it!

📝Document | 🤽‍♀️Playground

Install

npm i vue-use-form

🚀Features

  • 🦾 Type Strong: Written in TypeScript
  • 🏆 No Component: No need to import any components to use, you can use it in all UI framework
  • 😍 Easy to use: Just 2 main hooks: useForm, useFieldArray

Quick Start

Try it on playground

<script setup lang="ts">
import { useForm } from 'vue-use-form'

interface Inputs {
  username: string
}

const { 
  register, 
  formState: { errors },
  handleSubmit,
} = useForm<Inputs>()
</script>

<template>
  errors: {{ errors }}
  <form @submit.prevent="handleSubmit()()">
    <input
      :="register('username', {
        required: 'username field cannot be empty!'
      })"
    >
    <button type="submit">
      submit
    </button>
  </form>
</template>

use with schema

Open Source Agenda is not affiliated with "Vue Use Form Vue Use Form" Project. README Source: vue-use-form/vue-use-form

Open Source Agenda Badge

Open Source Agenda Rating