I am currently utilizing the vuelidate plugin for form validation.
import { required, maxLength } from 'vuelidate/lib/validators';
In my Vue component, I have a method called isFinishedFill()
:
methods: {
isFinishedFill() {
return !!this.disabledFinishedAt || !!this.finishedAtYear;
}
}
Now, I want to apply the required
rule from vuelidate to my function, but it's giving me an error:
validations: {
finishedAtYear: {
required: this.isFinishedFill,
},
}
Can someone please guide me on how to successfully apply the required function in this context?