Blame view

src/components/Popup/index.js 565 Bytes
liangyifan committed
1 2 3 4
import Vue from 'vue'
import Popup from './index.vue'

const PopupBox = Vue.extend(Popup)
yuanbo committed
5 6 7 8 9 10 11 12 13

/**
 * @description: install
 * @param {*} title
 * @param {*} editItem
 * @param {*} data
 * @param {*} formData
 * @author: renchao
 */
任超 committed
14
Popup.install = function (title, editItem, data, formData) {
任超 committed
15 16
  data.title = title
  data.editItem = editItem
任超 committed
17 18 19
  if (formData) {
    data.formData = formData
  }
liangyifan committed
20 21 22 23 24 25 26 27
  let instance = new PopupBox({
    data
  }).$mount()
  document.body.appendChild(instance.$el)
  Vue.nextTick(() => {
    instance.isShow = true
  })
}
任超 committed
28

任超 committed
29
export default Popup