You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
626 B

import Vue from 'vue'
import GlobalLoading from '@/components/GlobalLoading.vue'
const LoadingConstructor = Vue.extend(GlobalLoading)
let loadingInstance = null
export default {
show(text) {
if (!loadingInstance) {
loadingInstance = new LoadingConstructor({
el: document.createElement('div')
})
document.body.appendChild(loadingInstance.$el)
}
loadingInstance.show(text)
},
hide() {
if (loadingInstance) {
loadingInstance.hide()
}
},
setAnimation(animationData) {
if (loadingInstance) {
loadingInstance.setAnimationData(animationData)
}
}
}