Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mapgetters with parameter

  //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);
Source by www.rrrhys.com #
 
PREVIOUS NEXT
Tagged: #mapgetters #parameter
ADD COMMENT
Topic
Name
2+9 =