yyzone
Version:
yyzone vue components and utils
34 lines (28 loc) • 654 B
JavaScript
import YYLoading from './loading.js'
let LoadingInstance
function getLoadingInstance (options) {
LoadingInstance = LoadingInstance || YYLoading.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()
}
YYLoading.show = (options)=>{
show(options)
}
YYLoading.hide = ()=>{
hide()
}
export default YYLoading