25 lines
455 B
JavaScript
25 lines
455 B
JavaScript
// import axios from 'axios';
|
|
import { createStore } from 'vuex';
|
|
export default createStore({
|
|
state: {
|
|
isLoading: false,
|
|
},
|
|
mutations: {
|
|
setLoading(state, payload) {
|
|
console.log('payload');
|
|
state.isLoading = payload
|
|
},
|
|
},
|
|
actions: {
|
|
|
|
async updateIsLoading({ commit }, payload) {
|
|
commit('setLoading', payload)
|
|
},
|
|
},
|
|
getters: {
|
|
getIsLoading(state){
|
|
return state.isLoading
|
|
},
|
|
}
|
|
})
|