方法一:图片url是普通链接的情况
1、给<img>添加点击事件
<img alt="图片" :src="url" @click="openPicture(url)">
2、在js中写方法
openPicture(url){
if(url === ' ' || url === ''){
this.$message.warning('图片不存在');
}else{
window.open(url);
}
}
方法2:图片url是base64类型的情况
1、给<img>添加点击事件
<img alt="图片" :src="url" @click="openPicture(url)">
2、在js中写方法
openPicture(url){
let newOpen=window.open();
let img = newOpen.document.createElement("img");
img.src=url;
newOpen.document.body.appendChild(img);
},