Blame view

ant-design-vue-jeecg/src/components/jeecg/JModal/index.js 437 Bytes
肖超群 authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import JModal from './JModal'
import JPrompt from './JPrompt'

export default {
  install(Vue) {
    Vue.component(JModal.name, JModal)

    const JPromptExtend = Vue.extend(JPrompt)
    Vue.prototype.$JPrompt = function (options = {}) {
      // 创建prompt实例
      const vm = new JPromptExtend().$mount()
      vm.show(options)
      // 关闭后销毁
      vm.$on('after-close', () => vm.$destroy())
      return vm
    }
  },
}