import Vue from 'vue'
import Perspective from './dk-perspective.vue'

const messageBox = Vue.extend(Perspective)

Perspective.install = function (options, {ok}) {
  // if (typeof options === 'object') {
  //   options = {
  //     location: options
  //   }
  // }
  let instance = new messageBox({
    data: Object.assign(options, {okFunc: ok})
  }).$mount()
  document.body.appendChild(instance.$el)

  Vue.nextTick(() => {
    instance.visible = true
  })
}
export default Perspective
