feat: add Disclosure DisclosureGroup and Accordion
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
Accordion,
|
||||
AccordionBody,
|
||||
AccordionHeading,
|
||||
AccordionIndicator,
|
||||
AccordionItem,
|
||||
AccordionPanel,
|
||||
AccordionTrigger,
|
||||
} from "@heroui-vue/components";
|
||||
import {
|
||||
IconBox,
|
||||
IconChevronDown,
|
||||
IconCreditCard,
|
||||
IconShoppingBag,
|
||||
} from "@tabler/icons-vue";
|
||||
|
||||
const items = [
|
||||
{
|
||||
content:
|
||||
"浏览我们的商品,将商品加入购物车并前往结账。完成购买需要提供收货与支付信息。",
|
||||
icon: IconShoppingBag,
|
||||
title: "如何下单?",
|
||||
},
|
||||
{
|
||||
content:
|
||||
"可以,在订单发货前你可以修改或取消。订单一旦进入处理流程,将无法再更改。",
|
||||
icon: IconCreditCard,
|
||||
title: "可以修改或取消订单吗?",
|
||||
},
|
||||
{
|
||||
content: "我们接受主流信用卡,包括 Visa、Mastercard 和 American Express。",
|
||||
icon: IconBox,
|
||||
title: "支持哪些支付方式?",
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Accordion hide-separator class="w-full max-w-md">
|
||||
<AccordionItem v-for="(item, index) in items" :key="index">
|
||||
<AccordionHeading>
|
||||
<AccordionTrigger>
|
||||
<span class="me-3 size-4 shrink-0 text-muted">
|
||||
<component :is="item.icon" aria-hidden="true" />
|
||||
</span>
|
||||
{{ item.title }}
|
||||
<AccordionIndicator>
|
||||
<IconChevronDown />
|
||||
</AccordionIndicator>
|
||||
</AccordionTrigger>
|
||||
</AccordionHeading>
|
||||
<AccordionPanel>
|
||||
<AccordionBody>{{ item.content }}</AccordionBody>
|
||||
</AccordionPanel>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
</template>
|
||||
Reference in New Issue
Block a user