Answer the question
In order to leave comments, you need to log in
How to count objects in a VUE array?
You need to count the number of errors in the errors array, and if there are none, then (long story) ..
I'm trying to count in computed using an example from the Internet
errors_count: function () {
return this.errors.length
}
Answer the question
In order to leave comments, you need to log in
The object does not have a length property, so you need to cast it to an array (of values or keys)
errors_count: function () {
return Object.keys(this.errors).length;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question