cretueusebiu / vform

Handle Laravel-Vue forms and validation with ease.

Home Page:https://vform.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hello i have used it with nuxt but it has one issue

atta1234 opened this issue · comments

i m using vuetify and nuxt it display the errors well but when i write something the error is still thire until i submit the form
that keydown event not working i think any solution?
`


Log In

<v-form @submit.prevent="register"@keydown="form.onKeydown($event)">

      <v-text-field label="Name" name="name" v-model="form.name"/>
      <has-error :form="form" field="name"></has-error>

      <v-text-field label="Email" v-model="form.email"/>
      <has-error :form="form" field="email"></has-error>

      <v-text-field label="Password" v-model="form.password"/>
      <has-error :form="form" field="password"></has-error>

      <v-text-field label="Password" v-model="form.password_confirmation"/>


      <v-btn type="submit">Log In</v-btn>
    </v-form>
  </v-card-text>
</v-card>
<script> window.Form = Form; import Vue from 'vue' import axios from 'axios' import { Form, HasError, AlertError } from 'vform' Vue.component(HasError.name, HasError) Vue.component(AlertError.name, AlertError)

export default {
data() {
return {
form: new Form({
name: '',
email: '',
password: '',
password_confirmation: '',
})
}
},

methods: {
register(){
this.form.post('http://localhost/laravel-vue-spa-laravel-6.1/public/api/auth/register')
.then(({ data }) => {
this.$router.push('/')
})
},
}
}
</script>

<style scoped> .help-block { color: red; } </style>`

Hi @atta1234 <v-form> does not contain @keydown
Use <form> instead of <v-form> or use @keydown on <v-text-field>

thank you sir