import Vue from 'vue'
import UIViewLoading from './ViewLoading'
import UIWaiting from './Waiting'
import UISmallWaiting from './smallWaiting'
import UISmallWaiting1 from './smallWaiting1'



export const ViewLoading = Vue.extend(UIViewLoading)
export const Waiting = Vue.extend(UIWaiting)
export const SmallWaiting = Vue.extend(UISmallWaiting)
export const SmallWaiting1 = Vue.extend(UISmallWaiting1)


const waiting = function(){
    let instance = new Waiting().$mount()
    document.body.appendChild(instance.$el)
    return instance
}

const smallWaiting = function(){
    let instance = new SmallWaiting().$mount()
    document.body.appendChild(instance.$el)
    return instance
}

const smallWaiting1 = function(){
    let instance = new SmallWaiting1().$mount()
    document.body.appendChild(instance.$el)
    return instance
}

export function $viewLoading(data={}){
    let instance = new ViewLoading({data}).$mount()
    document.body.appendChild(instance.$el)
    return instance
}

// export function $Waiting(data={}){
//     let instance = new ViewLoading({data}).$mount()
//     document.body.appendChild(instance.$el)

//     return instance
// }

// export const $waiting = (function(){
//     let instance = new ViewLoading({data}).$mount()
//     document.body.appendChild(instance.$el)
// }())



export const $waiting = waiting()
export const $smallWaiting = smallWaiting()

export const $smallWaiting1 = smallWaiting1()



