Filtering object within the array #9155
-
Hello Quasar friends :) I want to ask about filtering the object inside the array. If I have 3 variables (focuses1, focuses2, focuses3)
I want to filter only the array with the property of I have tried with computed method using filter function, but I got confuse with how the syntax works :'D... Or is there any other method, guys? Thanks in advance for helping :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
const something = computed(() => focuses3.filter(v => v.priority[0] === '1st'))
//or
const something2 = computed(() => focuses3.filter(v => v.priority.some(j => j === '1st'))) https://v3.vuejs.org/api/computed-watch-api.html#computed |
Beta Was this translation helpful? Give feedback.
https://v3.vuejs.org/api/computed-watch-api.html#computed
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some