feat: add Disclosure DisclosureGroup and Accordion
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import {
|
||||
Button,
|
||||
Disclosure,
|
||||
DisclosureBody,
|
||||
DisclosureContent,
|
||||
DisclosureHeading,
|
||||
DisclosureIndicator,
|
||||
DisclosureTrigger,
|
||||
} from "@heroui-vue/components";
|
||||
import { IconShoppingBag } from "@tabler/icons-vue";
|
||||
|
||||
const isExpanded = ref(false);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="w-full max-w-sm">
|
||||
<Disclosure v-model:expanded="isExpanded">
|
||||
<DisclosureHeading>
|
||||
<DisclosureTrigger as-child>
|
||||
<Button
|
||||
class="w-full justify-between rounded-xl border border-border/70 bg-linear-to-b from-neutral-50/90 to-white px-4 py-3 font-medium text-foreground shadow-sm ring-1 ring-black/5 hover:bg-muted/30 dark:from-neutral-900/80 dark:to-neutral-900 dark:ring-white/10"
|
||||
variant="ghost"
|
||||
>
|
||||
<span class="flex items-center gap-2">
|
||||
<IconShoppingBag class="size-4 text-muted" aria-hidden="true" />
|
||||
配送详情
|
||||
</span>
|
||||
<DisclosureIndicator class="text-muted" />
|
||||
</Button>
|
||||
</DisclosureTrigger>
|
||||
</DisclosureHeading>
|
||||
<DisclosureContent>
|
||||
<DisclosureBody
|
||||
class="mt-2 rounded-xl border border-border/70 bg-surface/50 p-4 text-sm leading-relaxed text-muted dark:bg-neutral-900/50"
|
||||
>
|
||||
订单将在 2 个工作日内发货。标准配送需 3–5 天;结账时可选择加急配送。
|
||||
</DisclosureBody>
|
||||
</DisclosureContent>
|
||||
</Disclosure>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user