问题:el-image打开大图预览时,只能点击关闭按钮才能关闭,点击蒙层不能关闭的
methods: {handleClickStop() {this.$nextTick(() => {const domImageView = document.querySelector(".el-image-viewer__mask") // 获取遮罩层domif (!domImageView) {return}domImageView.addEventListener('click', () => {// 点击遮罩层时调用关闭按钮的 click 事件document.querySelector('.el-image-viewer__close').click()})})}}
修改按钮样式
/deep/ {.el-image {.el-image-viewer__actions__inner {i {font-size: 23px;}}.el-image-viewer__close {.el-icon-circle-close {font-size: 40px;color: #ffffff;}}}
}
完美解决