I'm trying to access the validation flags from a computed prop:
computed: {
isFormValid() {
let isValid = this.$validator.fields.some(field => {
console.log(field.flags);
return field.flags.touched; || field.flags.invalid;
});
console.log("isValid", isValid);
return isValid;
}
},
But this gives an error: "TypeError: this.$validator.fields.some is not a function"
So then I figured I would iterate over the observable:
let isValid = Array.from(this.$validator.fields).some(field => {
console.log(field.flags);
return field.flags.touched; //|| field.flags.invalid;
});
Yay! Progress! No more error. But it doesn't recompute when I change the form input values.
So how can I do this?