Open my9074 opened 7 years ago
HI~
my most of Ajax was in the action of vuex,how to use loading in vuex ajax loading ?
const actions = { [type.FETCH_MOVIES] (context, payload) { api.fetchMovies(payload.type, {start: payload.start || 0}) .then(data => context.commit(type.FETCH_MOVIES, { type: payload.type, subjects: data.subjects, total: data.total })) } }
I suggest you to use eventBus. Emit an event and listen it on the main.js
https://github.com/staskjs/vue-resource-progressbar-interceptor
HI~
my most of Ajax was in the action of vuex,how to use loading in vuex ajax loading ?