import { VxeUI } from 'vxe-pc-ui'

/**
 * v-select指令
 * 选中输入框
 */
export default function imgPreview(el: HTMLImageElement) {
  if (el.tagName === 'IMG') {
    el.style.cursor = 'pointer'
    el.addEventListener('click', () => {
      VxeUI.previewImage({
        maskClosable: true,
        escClosable: true,
        urlList: [{ url: el.src }],
      })
    })
  }
}
