M
M
Maxim2020-09-03 11:49:57
Vue.js
Maxim, 2020-09-03 11:49:57

How to check for props?

Good day, comrades. Tell the young and green. I use validation in vuetify, on the submit button:

this.formHasErrors = false;
Object.keys(this.form).forEach(f => {
  if(!this.form[f]){
    this.formHasErrors = true;
    this.$refs[f].validate(true);
  }
})

this.$refs doesn't always have a validate prop, but when it doesn't, there is a ref inside that has that prop. How can you take the validate of an internal ref if the one being checked does not have it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question