Skip to content

How to get Vuex mutation access in a js file outside of vue components. #8814

Discussion options

You must be logged in to vote

use injection:

export function setTheNewThing(store, newData) {
  store.commit('setMyThing', newData);
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@JesseRatt
Comment options

@metalsadman
Comment options

Answer selected by JesseRatt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants