This is an experiential repo to port react hook form into the Vue world.
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>
);
}
};
Want your logo here? DM on Twitter
Thanks goes to all our backers! [Become a backer].
Thanks goes to these wonderful organizations! [Contribute].
Thanks goes to these wonderful people! [Become a contributor].