import Vue from 'vue';
import Wait from './Wait.vue';
const WaitConstructor = Vue.extend(Wait);

const Waiting = function(options: any) {
  options = options || {};
  if (typeof options === 'string') {
    options = {
      text: options
    }
  }
  const instance = new WaitConstructor({
    el: document.createElement('div'),
    data: options,
  });
  instance.$mount()
  document.body.append(instance.$el)
  return instance
}

export default Waiting
