Skip to content

vue-hooks-form/vue-hooks-form

Repository files navigation

vue-hooks-form

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

Documentation | Getting Started | Playground



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 1 main hooks: useForm
<script setup lang="ts">
import { useForm } from '@vue-hooks-form/core'
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>

Credits

Thanks to:

License

MIT License © 2023-Present Elone Hoo

About

Vue Composition API for validating form.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Contributors 3

  •  
  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy