yyzone
Version:
yyzone vue components and utils
34 lines (28 loc) • 644 B
JavaScript
import Loading from './loading.js'
let LoadingInstance
function getLoadingInstance (options) {
LoadingInstance = LoadingInstance || Loading.newInstance(options)
return LoadingInstance
}
function show(options) {
options = options || {}
options.onRemove = function () {
LoadingInstance = null
}
let instance = getLoadingInstance(options)
instance.show(options)
}
function hide() {
if (!LoadingInstance) {
return false
}
let instance = getLoadingInstance()
instance.hide()
}
Loading.show = (options)=>{
show(options)
}
Loading.hide = ()=>{
hide()
}
export default Loading