dataease/frontend/src/utils/loading.js

21 lines
558 B
JavaScript
Raw Normal View History

2021-03-04 14:58:52 +08:00
import store from '@/store'
export const tryShowLoading = identification => {
if (!identification) return
// const count = store.getters.loadingMap[identification]
store.dispatch('request/addLoading', identification)
}
export const tryHideLoading = identification => {
if (!identification) return
const count = store.getters.loadingMap[identification]
if (count > 0) {
// setTimeout(() => {
// store.dispatch('request/reduceLoading', identification)
// }, 1000)
store.dispatch('request/reduceLoading', identification)
}
}