[Vuejs]-How to filter from array elements in Vue JS

4👍

So basically you’re saying that contactName is an array of contacts instead of just one, and you want to match all meetings that have at least one contact in contactName with name matching searchContact?

Try this (untested):

.filter(item =>
  item.client_name.toLowerCase().includes(search) &&
  item.contactName.some(c =>
    (c.first_name + ' ' + c.last_name).toLowerCase().includes(searchContact)
  )
)

Also I should mention it’s confusing to mix camelCase and snake_case for contactName and client_name, respectively. Pick one.

Leave a comment