feat: add Disclosure DisclosureGroup and Accordion
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
Accordion,
|
||||
AccordionBody,
|
||||
AccordionHeading,
|
||||
AccordionIndicator,
|
||||
AccordionItem,
|
||||
AccordionPanel,
|
||||
AccordionTrigger,
|
||||
} from "@heroui-vue/components";
|
||||
|
||||
const items = [
|
||||
{
|
||||
content:
|
||||
"了解 HeroUI 的基础知识,以及如何将其集成到你的 React 项目中。本节涵盖安装、配置和你的第一个组件。",
|
||||
title: "快速开始",
|
||||
},
|
||||
{
|
||||
content:
|
||||
"理解 HeroUI 背后的核心概念,包括复合组件模式、使用 Tailwind CSS 进行样式设计,以及无障碍特性。",
|
||||
title: "核心概念",
|
||||
},
|
||||
{
|
||||
content:
|
||||
"探索高级特性,例如自定义变体、主题定制,以及与 React 生态中其他库的集成。",
|
||||
title: "高级用法",
|
||||
},
|
||||
{
|
||||
content:
|
||||
"遵循我们建议的最佳实践,使用 HeroUI 构建高性能、无障碍且易于维护的应用。",
|
||||
title: "最佳实践",
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Accordion allows-multiple-expanded class="w-full max-w-md">
|
||||
<AccordionItem v-for="(item, index) in items" :key="index">
|
||||
<AccordionHeading>
|
||||
<AccordionTrigger>
|
||||
{{ item.title }}
|
||||
<AccordionIndicator />
|
||||
</AccordionTrigger>
|
||||
</AccordionHeading>
|
||||
<AccordionPanel>
|
||||
<AccordionBody>{{ item.content }}</AccordionBody>
|
||||
</AccordionPanel>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
</template>
|
||||
Reference in New Issue
Block a user