mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-24 17:03:00 +10:00
feat(add modal stack): created modal stack and confirmation
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<ModalStack />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
onMounted(() => {
|
||||
createModal(
|
||||
ModalType.Confirmation,
|
||||
{
|
||||
title: "Are you sure?",
|
||||
description:
|
||||
"Are you sure you want to complete this action? It may have unintended side effects.",
|
||||
},
|
||||
async (event, close) => {
|
||||
switch (event) {
|
||||
case "confirm":
|
||||
await new Promise((r) => setTimeout(r, 3000));
|
||||
close();
|
||||
break;
|
||||
case "cancel":
|
||||
close();
|
||||
break;
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user