ImagePreview查看gif图,关闭之后原图不动了
vant的ImagePreview查看大图,当查看的是gif图的时候,关闭查看大图弹窗,原图不动了,ios上几乎必现。
解决的方案是,监听onclose事件,在关闭的时候把原图的gif图地址重新设置一下就好了
sceneImg(url: string) {const index = this.imgList.indexOf(url)ImagePreview({images: this.imgList, //需要预览的图片 URL 数组showIndex: true, //是否显示页码loop: false, //是否开启循环播放startPosition: index < 0 ? 0 : index, //图片预览起始位置索引closeable: true,onClose:()=>{url = /\?/.test(url) ? `${url}&id=${+new Date()}` : `${url}?id=${+new Date()}`}})}