<template>
  <el-image-viewer v-if="imgShow" @close="imgShow=false" ref="imgRef" :url-list="[img]" />
</template>

<script setup>
import { ref, getCurrentInstance } from 'vue'

const { proxy } = getCurrentInstance();

const img = ref("");

const imgShow = ref(false);


const open = async (src) => {
  img.value = src;
  imgShow.value = true
  await proxy.$nextTick();
}

defineExpose({open})
</script>
