1.给图片点击查看创造全局变量 在data中定义 instance_before
lookImg() {
this.instance_before = ImagePreview({
images: [this.detailInfo.acupoint_img],//this.detailInfo.acupoint_img图片地址改成自//己的图片地址
});
},
2.在当前页面同过钩子函数在路由离开的时候,关闭预览的图片
beforeRouteLeave(to, from, next) {
this.instance_before.close();
next();
},
完美解决