[Vuejs]-My validation code on form isn't working properly

0πŸ‘

βœ…

In your postData method you are checking for the input data, like so:

if(!this.questionTitle) { }

But your form items v-model properties are hooked to the posts object in your component data, so your code should look like this:

if(!this.posts.questionTitle) { }

You need to change this for all the posts properties you check out send during submission.

Leave a comment