Vue Mapgetters avec paramètre
//store/getters.js
usersForMember: (state) => (member) => {
return state.users.data.filter(u => u.member_id === member.id)
}
//someComponent.vue
computed: {
...mapGetters({usersForMember: 'users/usersForMember'}),
}
//To use
this.usersFormMember(21);
AussieCoder