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

📅  最后修改于: 2022-03-11 14:55:32.329000             🧑  作者: 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);