📜  带参数的 mapgetters - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:24.043000             🧑  作者: Mango

代码示例1
//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);