I can't figure out why this error is coming.
Another error is coming:
TypeError: Cannot read property 'name' of undefined
This is my Vue File:
<v-text-field
label="Name *"
type="text"
v-model="form.name"
required
>
</v-text-field>
<div v-if="errors.name">
<span class="red--text">{{ errors.name[0] }}</span>
</div>
</v-text-field>
In script tag:
export default{
data() {
return {
form: {
name: ''
},
errors: {}
}
},
methods: {
signup(){
axios
.post('/api/auth/signup', this.form)
.then(result => console.log(result.data))
.catch(err => this.errors = err.response.data.errors)
}
}
}
signup()
? – Harshal Patil