wy-ei / vue-filter

:v: A collection of Vue.js filter. [Depressed]
MIT License
353 stars 37 forks source link

Difference with an array of objects #19

Open artcrespo opened 6 years ago

artcrespo commented 6 years ago

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.

wy-ei commented 6 years ago

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