Files
heroui-vue/apps/docs/demos/drawer-backdrop-variants.vue
T

55 lines
1.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import {
Button,
Drawer,
DrawerBackdrop,
DrawerBody,
DrawerClose,
DrawerCloseTrigger,
DrawerContent,
DrawerDialog,
DrawerFooter,
DrawerHandle,
DrawerHeader,
DrawerHeading,
} from "@heroui-vue/components";
const VARIANT_LABELS = {
blur: "模糊",
opaque: "不透明",
transparent: "透明",
} as const;
const variants = ["opaque", "blur", "transparent"] as const;
</script>
<template>
<div class="flex flex-wrap gap-4">
<Drawer v-for="variant in variants" :key="variant">
<Button variant="secondary">{{ VARIANT_LABELS[variant] }}</Button>
<DrawerBackdrop :variant="variant">
<DrawerContent>
<DrawerDialog>
<DrawerHandle />
<DrawerCloseTrigger />
<DrawerHeader>
<DrawerHeading>背景:{{ VARIANT_LABELS[variant] }}</DrawerHeading>
</DrawerHeader>
<DrawerBody>
<p>
此抽屉使用
<code>{{ variant }}</code>
背景变体。
</p>
</DrawerBody>
<DrawerFooter>
<DrawerClose as-child>
<Button class="w-full">关闭</Button>
</DrawerClose>
</DrawerFooter>
</DrawerDialog>
</DrawerContent>
</DrawerBackdrop>
</Drawer>
</div>
</template>