vue-filter icon indicating copy to clipboard operation
vue-filter copied to clipboard

Difference with an array of objects

Open artcrespo opened this issue 7 years ago • 1 comments

Hi,

I tested other filters and also this one with arrays that contained simple data such as string and integers. And I would like to know if eventually this filter will be able to filter arrays with complex data (objects) like obj { id: someInteger, txt: 'someString' }. I am a newbie in the Frond-End development and also with technologies like VueJs. So, maybe there's is a way to do it with filters but I just don't know how.

Thank you.

artcrespo avatar Nov 26 '17 19:11 artcrespo

Sorry, I know I am late to reply you. The following code could solve this problem:

data: {
  list: [{
      name: 'James, LeBron',
      score: 38
  },{
      name: 'Irving, Kyrie',
      score: 43
  },{
      name: 'Jefferson, Richard',
      score: 11
  }]
}

{{ list[0] | get('score') }} => 38

wy-ei avatar Feb 08 '18 02:02 wy-ei