I have a vuex store, like following:
import spreeApi from \'../../gateways/spree-api\'
// initial state
const state = {
products: [],
categories: []
}
// mu
First, assign the Vue button to a variable: In main.js:
export const app = new Vue({
router,
vuetify,
store,....
Then import the "app" variable to the js file where you define the mutation: In modules.js:
import { app } from "../../main";
You can now use it as "app.$store.commit":
mutations: {
[AUTH_SET_TOKEN]: () => {
app.$store.commit(USER_SUCCESS, params );
},...