📜  vue store getter 向 getter 发送值 - 任何代码示例

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

代码示例1
// generally getter does not take arguments, but there is an option to use method style getters
// Example to method style getter:

new Vuex.Store({
  getters: {
    someMethod: (state) => (id) => {
        return state.things.find(thing => thing.id === id)
      }
    };       
  }
})