import Vue from "vue"; import Vuex from "vuex"; Vue.use(Vuex); export default new Vuex.Store({ state: { authenticated: false, apiUrl: "http://localhost:7575/api/v8.0/", userId: 0, roles: 0, navItems: [] }, mutations: { authenticated(state, data) { // mutate state state.authenticated = data.authenticated; state.userId = data.userId; state.roles = data.roles; }, notAuthenticated(state) { state.authenticated = false; state.userId = 0; state.roles = 0; } }, actions: {} });