vuexjs getter with argument

An ES6 arrow function would work nicely here too. For example, sake, let’s say you’re looking for a particular ‘thing’ in your store.

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

Here is another example via the Vuex documentation

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)