msgBox.js 425 B

1234567891011121314151617
  1. import MsgBox from '_c/MsgBox.vue'
  2. let ConfirmConstructor, instance
  3. const showMsgBox = {
  4. install(Vue) {
  5. ConfirmConstructor = Vue.extend(MsgBox)
  6. instance = new ConfirmConstructor().$mount()
  7. document.body.appendChild(instance.$el)
  8. Vue.prototype.$showMsgBox = options => {
  9. Object.assign(instance, options)
  10. instance.init()
  11. }
  12. }
  13. }
  14. export default showMsgBox