import Vue from 'vue'
import EasyDialogComponent from './EasyDialog.vue'

const EasyDialogConstructor = Vue.extend(EasyDialogComponent)

const EasyDialog = (options = {}) => {
  const instance = new EasyDialogConstructor({
    data: {
      options
    }
  })
  instance.$mount()
  const dom = instance.$el
  document.body.appendChild(dom)
  return instance
}
Vue.prototype.$easyDialog = EasyDialog
export default EasyDialog
