import Vue from 'vue'
import Position from './dk-position.vue'

const messageBox = Vue.extend(Position)

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

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