import ImgPreviewComponent from './ImgPreview.vue'
 
const ImgPreview = {}
 
ImgPreview.install = Vue => {
  const ImgConstructor = Vue.extend(ImgPreviewComponent)
 
  const instance = new ImgConstructor()
 
  instance.$mount(document.createElement('div'))
 
  document.body.appendChild(instance.$el)
 
  Vue.prototype.$imgPreview = (e,i) => {
    instance.target = e.currentTarget
    instance.imgs = instance.target.getAttribute('data-img').split(',')
    instance.isShowImageDialog = true
    instance.curIdx = i
    instance.change(i)
  }
  // Vue.component('imgPreview',ImgPreviewComponent)
}
 
export default ImgPreview