feat: migrate AlertDialog and Drawer with reviewed overlay lifecycles

This commit is contained in:
maoyingjie
2026-10-23 18:34:07 +08:00
parent 9f44ffb310
commit 0ec20aaa6a
83 changed files with 5871 additions and 3 deletions
+48
View File
@@ -0,0 +1,48 @@
<script setup lang="ts">
import {
AlertDialog,
AlertDialogBackdrop,
AlertDialogBody,
AlertDialogClose,
AlertDialogCloseTrigger,
AlertDialogContainer,
AlertDialogDialog,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogHeading,
AlertDialogIcon,
Button,
} from "@heroui-vue/components";
</script>
<template>
<AlertDialog>
<Button variant="danger">删除项目</Button>
<AlertDialogBackdrop>
<AlertDialogContainer>
<AlertDialogDialog class="sm:max-w-[400px]">
<AlertDialogCloseTrigger />
<AlertDialogHeader>
<AlertDialogIcon status="danger" />
<AlertDialogHeading>要永久删除项目吗?</AlertDialogHeading>
</AlertDialogHeader>
<AlertDialogBody>
<p>
此操作将永久删除
<strong>我的精彩项目</strong>
及其全部数据,且无法撤销。
</p>
</AlertDialogBody>
<AlertDialogFooter>
<AlertDialogClose as-child>
<Button variant="tertiary">取消</Button>
</AlertDialogClose>
<AlertDialogClose as-child>
<Button variant="danger">删除项目</Button>
</AlertDialogClose>
</AlertDialogFooter>
</AlertDialogDialog>
</AlertDialogContainer>
</AlertDialogBackdrop>
</AlertDialog>
</template>