feat: migrate Toast and Table with reviewed state focus and SSR contracts

This commit is contained in:
maoyingjie
2026-10-24 07:19:26 +08:00
parent 0cfe7b6195
commit ed41af5294
95 changed files with 9358 additions and 8 deletions
+36
View File
@@ -0,0 +1,36 @@
<script setup lang="ts">
import { onBeforeUnmount } from "vue";
import {
Button,
ToastProvider,
ToastQueue,
createToastFunction,
} from "@heroui-vue/components";
const queue = new ToastQueue();
const toast = createToastFunction(queue);
onBeforeUnmount(() => queue.destroy());
</script>
<template>
<div class="flex h-full max-w-xl flex-wrap items-center justify-center gap-4">
<Button size="sm" variant="secondary" @click="toast('简单消息')">
默认
</Button>
<Button size="sm" variant="secondary" @click="toast.success('操作已完成')">
成功
</Button>
<Button size="sm" variant="secondary" @click="toast.info('有新更新可用')">
信息
</Button>
<Button
size="sm"
variant="secondary"
@click="toast.warning('请检查您的设置')"
>
警告
</Button>
<Button size="sm" variant="secondary" @click="toast.danger('出了点问题')">
错误
</Button>
<ToastProvider :queue="queue" to="body" />
</div>
</template>