引用:https://blog.csdn.net/this_zq/article/details/134535539
<el-image-viewer
v-if="showImagePreview"
:zoom-rate="1.2"
@close="closePreview"
:url-list="imgPreviewList"
/>
const showImagePreview = ref(false)
const imgPreviewList = ref([])
const showGameStrategy = (url)=>{
if (!url){
ElMessage.warning("该攻略没有图片")
}
showImagePreview.value = true
imgPreviewList.value = [IMG_PREFIX+url]
}
const closePreview = ()=>{
imgPreviewList.value = []
showImagePreview.value = false
}