feat: handle close and cancel events in Modal component
This commit is contained in:
parent
d3aeccf3f9
commit
6578b95704
1 changed files with 6 additions and 0 deletions
|
@ -15,6 +15,12 @@ const dialog = ref<HTMLDialogElement>();
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (dialog) {
|
if (dialog) {
|
||||||
dialog.value?.showModal();
|
dialog.value?.showModal();
|
||||||
|
if (props.onClose) {
|
||||||
|
dialog.value?.addEventListener("close", props.onClose);
|
||||||
|
}
|
||||||
|
if (props.onCancel) {
|
||||||
|
dialog.value?.addEventListener("cancel", props.onCancel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue