import Vue from 'vue'
import Warn from './warn.vue';

const warnConstructor = Vue.extend(Warn)

let instance
Warn.show = () => {
  if(!instance) {
    instance = new warnConstructor({
      el: document.createElement('div'),
      data () {
        return {
          visible : true
        }
      }
    })
  
    document.body.appendChild(instance.$el)
  } else {
    instance.visible = true
  }
}

Warn.hide = () =>{
  if(instance) {
    instance.visible = false;
  }
}

export default Warn




