Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.

Latest commit

 

History

History
65 lines (46 loc) · 1.75 KB

README.md

File metadata and controls

65 lines (46 loc) · 1.75 KB

🧪 Vue Hook Form (experiential)

This is an experiential repo to port react hook form into the Vue world.

Quickstart

import { useForm } from "@hookform/vue";

export default {
  setup() {
    return useForm();
  },
  onSubmit(data) {
    console.log(data);
  },
  render() {
    return (
      <form onSubmit={this.handleSubmit(this.onSubmit)}>
        <input ref={this.register({ required: true })} name="firstName" />
        {this.errors.firstName && "This is required."}

        <input ref={this.register({ required: true })} name="lastName" />
        {this.errors.lastName && "This is required."}

        <input type="submit" />
      </form>
    );
  }
};

Sponsors


Want your logo here? DM on Twitter

Backers

Thanks goes to all our backers! [Become a backer].

Organizations

Thanks goes to these wonderful organizations! [Contribute].

Contributors

Thanks goes to these wonderful people! [Become a contributor].