element-ui图片标签的一个坑

相关源码
version: "2.13.0"
node_modules->element-ui->lib->element-ui.common.js文件L38219附近



clickHandler: function clickHandler() {
// prevent body scroll
prevOverflow = document.body.style.overflow;
document.body.style.overflow = 'hidden';
this.showViewer = true;
}


导致的bug
页面上有图片上传按钮,点击上传图片之后发现页面无法向下滚动,body标签的溢出被隐藏,看不到页面底部的内容。

解决方法

  • el-image的父级元素阻止事件冒泡
  • 不使用el-image标签
  • element-ui 降版至2.10以下