mutations: {
getData(state, list){
state.list = list
console.log(state.list)
}
},
actions:{
list(context) {
if (context.search != '') {
HTTP.post(Routes.getList, {
params: {
"period": 0,
"date": "2019-03-05T15:12:13.319Z"
}
})
.then(data => {
context.commit('getData', data)
})
.catch(error => {
console.log(error);
});
}
},
}
})
actionA ({ commit }) {
return new Promise((resolve, reject) => {
setTimeout(() => {
commit('someMutation')
resolve()
}, 1000)
})
}