Element UI 组件 Dialog 中 before-close 与 close 的区别

dialog
  width="600px"
  :title="title"
  :visible.sync="dialogVisible"
  :close-on-click-modal="false"
  :before-close="handleBeforeClose"
  @open="handleOpen"
  @close="handleClose"
>

 

总结:

1、点击 ”x“ 或”取消“按钮会依次调用  handleBeforeClose()、handleClose() ,点击”确定“按钮仅调用 handleBeforeClose()

2、若想在点击确定后关闭弹窗或处理其他逻辑,应使用 before-close。因为点击 ”x“ 或”取消“按钮本身就会关闭弹窗,无须额外处理

千百度
© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容