Uploader图片预览报错 Cannot read property 'target' of undefined
chanStudent opened this issue · comments
chanStudent commented
重现链接
Vant 版本
4.0.6
描述一下你遇到的问题。
重现步骤
图片上传,第二次点击预览报错
设备/浏览器
No response
chanStudent commented
我项目是4.0.6的
请看我上传的视频
https://hlcg.fjoss.xstore.ctyun.cn/Video_00038.wmv
Gavin commented
我这试了 微信、Chrome、Safari、小程序web-view都正常....
最好能提供个最小复现仓库。
SplendidDream commented
猜测可能是 Image 组件中延迟加载,在 onLazyLoaded 和 onMounted/nextTick函数中 onLoad() 调用没有传 event参数,导致 ImagePreview组件下面代码:
const onLoad = (event) => {
const {
naturalWidth,
naturalHeight
} = event.target;
state.imageRatio = naturalHeight / naturalWidth;
};
中 的 event是 undefined。
neverland commented
@SplendidDream 你说的这个问题已经修复过咯
neverland commented
由于未复现,这个 issue 先 close 了。
如果有复现链接的话再 re-open。