[Vuejs]-Not able to filter using lodash in computed Nuxt

2👍

You don’t really need lodash for this.

Use a vanilla JS filter method like this

return this.data.filter((el) => !el.deleted.status)

or this if you want to check for strict equality to false, rather than just using a falsy value (undefined, null, etc…)

return this.data.filter((el) => el.deleted.status === false)
👤kissu

2👍

While using lodash is not necessary, to answer your question

return _.filter(fields, 'deleted.status', false)

or

return _.filter(fields, {deleted: {status: false}})

Leave a comment