import showDialog from './visualDialog.vue'
import Vue from 'vue'
import router from '@/router'
const Toast = {};

// 注册Toast

Toast.install = function(Vue) {
    const ToastConstructor = Vue.extend(showDialog)

    const instance = new ToastConstructor({ router });

    instance.$mount()
    document.body.appendChild(instance.$el)


    Vue.prototype.$showDialog = (msg, flag, id, duration = 1500) => {
        instance.visuals = msg;
        instance.dialogVisible = flag;
        instance.id = id
    }

}

export default Toast