ElementUI 弹窗问题,求指导

clipboard.png

这是ElementUI 的弹窗,官方给出的代码是这样的

<script>
export default {

methods: {
  open2() {
    this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning'
    }).then(() => {
      this.$message({
        type: 'success',
        message: '删除成功!'
      });
    }).catch(() => {
      this.$message({
        type: 'info',
        message: '已取消删除'
      });          
    });
  }
}

}
</script>

点击取消则会关闭弹窗和遮罩层

然后,自己写

clipboard.png

一样有弹窗,但是点击关闭之后

clipboard.png

弹窗关闭了,但是遮罩层还在。 求指导怎么回事。。??

阅读 9.6k
3 个回答

你的父级层以上也用了el-dialogel-dialog层级会自动计算,所以你用的时候可以加上modal-append-to-body:false只相对于你的父级弹出

this.addLoading = false; 这个没有在catch里面加

catch(e=>{ this.addLoading = false }); catch里面把loading置为false

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题