Modal add before-close prop

This commit is contained in:
梁灏 2021-09-07 10:32:04 +08:00
parent ce92e4add3
commit 95bf1bfae9
2 changed files with 34 additions and 2 deletions

View file

@ -5,7 +5,9 @@
v-model="modal1"
title="Common Modal dialog box title"
@on-ok="ok"
@on-cancel="cancel">
@on-cancel="cancel"
:before-close="handleBeforeClose"
>
<p>Content of dialog</p>
<p>Content of dialog</p>
<p>Content of dialog</p>
@ -145,6 +147,20 @@
handleSpinShow () {
this.$Spin.show();
},
handleBeforeClose () {
return new Promise((resolve, reject) => {
this.$Modal.confirm({
title: '关闭确认',
content: '您确认要关闭弹窗吗?',
onOk: () => {
resolve();
},
onCancel: () => {
reject();
}
});
});
}
}
}
</script>