I'm attempting to retrieve the validation flags from a computed property:
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;
}
},
However, I encountered an error stating:
"TypeError: this.$validator.fields.some is not a function"
To address this issue, I decided to iterate over the observable
:
let isValid = Array.from(this.$validator.fields).some(field => {
console.log(field.flags);
return field.flags.touched; //|| field.flags.invalid;
});
Success! The error has been resolved. Yet, it doesn't update when I modify the form input values.
So, how can I tackle this challenge?