feat: migrate Toast and Table with reviewed state focus and SSR contracts
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount } from "vue";
|
||||
import { h } from "vue";
|
||||
import { IconStar } from "@tabler/icons-vue";
|
||||
import {
|
||||
Button,
|
||||
ToastProvider,
|
||||
createToastFunction,
|
||||
ToastQueue,
|
||||
type ToastContentValue,
|
||||
} from "@heroui-vue/components";
|
||||
|
||||
const queue = new ToastQueue<ToastContentValue>();
|
||||
onBeforeUnmount(() => queue.destroy());
|
||||
const toast = createToastFunction(queue);
|
||||
function show() {
|
||||
toast("自定义图标指示器", {
|
||||
indicator: h(IconStar, { class: "size-5", "aria-hidden": "true" }),
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col gap-3">
|
||||
<Button size="sm" variant="secondary" @click="show">自定义指示器</Button>
|
||||
<ToastProvider :queue="queue" to="body" />
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user