-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
modal对话框的关闭前确认。
What does the proposed API look like?
<!--template-->
<a-modal :beforeClose="beforeClose">
</a-modal>//javascript
//返回布尔值的方式
const beforeClose = () => {
return false;//返回true时允许关闭,返回false取消关闭。
}
//或可以支持promise
const beforeClose = () => new Promise((resolve, reject) => {
let cfm = confirm('内容尚未保存,关闭弹窗将丢失数据,确定关闭吗?')
if(cfm) return resolve()
return reject()
})