R后悔药 Rue.js
  • 首页
    • 深度指南
    • 实战例子
    • 快速上手
    • 路由指南
    • 术语表
    • 错误代码参考
  • API
    • 合作伙伴
    • 插件
    • 组件库
    • 工具链
    • Text.js
    • 新闻简报
    • 常见问题
    • 团队
    • 版本发布
    • 社区指南
    • 行为规范
    • 隐私政策
  • 赞助
  • 合作伙伴
设置
目录统计
总条目
  • 按钮 Button
  • 排版 Typography
  • 时间选择器 TimePicker
  • 下拉菜单 Dropdown
  • 悬浮操作按钮 FAB
  • 模态框 Modal
  • 切换 Swap
  • 主题控制器 Theme Controller
  • 手风琴 Accordion
  • 头像 Avatar
  • 徽标 Badge
  • 卡片 Card
  • 轮播 Carousel
  • 聊天气泡 Chat
  • 折叠面板 Collapse
  • 倒计时 Countdown
  • 描述列表 Descriptions
  • 对比 Diff
  • 二维码 QRCode
  • 悬浮 3D 卡片 Hover 3D
  • 悬浮画廊 Hover Gallery
  • 键盘提示 Kbd
  • 列表 List
  • 统计 Stat
  • 状态 Status
  • 表格 Table
  • 文本轮播 Text Rotate
  • 时间线 Timeline
  • 锚点 Anchor
  • 固钉 Affix
  • 面包屑 Breadcrumbs
  • 底部导航 Dock
  • 链接 Link
  • 菜单 Menu
  • 导航栏 Navbar
  • 分页 Pagination
  • 步骤 Steps
  • 选项卡 Tabs
  • 提示 Alert
  • 结果页 Result
  • 空状态 Empty
  • 加载 Loading
  • 全局提示 Message
  • 进度条 Progress
  • 环形进度 Radial Progress
  • 骨架屏 Skeleton
  • 通知提醒框 Notification
  • 轻提示 Toast
  • 气泡确认框 Popconfirm
  • 气泡卡片 Popover
  • 工具提示 Tooltip
  • 日历 Calendar
  • 颜色选择器 ColorPicker
  • 复选框 Checkbox
  • 字段集 Fieldset
  • 表单 Form
  • 文件输入 File Input
  • 筛选器 Filter
  • 标签 Label
  • 单选框 Radio
  • 范围选择 Range
  • 评分 Rating
  • 分段选择 Segmented
  • 自动完成 AutoComplete
  • 选择器 Select
  • 树选择 TreeSelect
  • 树控件 Tree
  • 提及输入 Mentions
  • 穿梭框 Transfer
  • 漫游引导 Tour
  • 输入框 Input
  • 数字输入 InputNumber
  • 文本域 Textarea
  • 开关 Toggle
  • 校验器 Validator
  • 分隔线 Divider
  • 弹性布局 Flex
  • 分割面板 Splitter
  • 抽屉侧边栏 Drawer
  • 页脚 Footer
  • 栅格 Grid
  • 瀑布流 Masonry
  • 布局 Layout
  • 主视觉区 Hero
  • 指示器 Indicator
  • 组合项 Join
  • 蒙版 Mask
  • 水印 Watermark
  • 间距 Space
  • 堆叠 Stack
  • 浏览器样机 Mockup Browser
  • 代码样机 Mockup Code
  • 手机样机 Mockup Phone
  • 窗口样机 Mockup Window
目录统计
总条目
  • 按钮 Button
  • 排版 Typography
  • 时间选择器 TimePicker
  • 下拉菜单 Dropdown
  • 悬浮操作按钮 FAB
  • 模态框 Modal
  • 切换 Swap
  • 主题控制器 Theme Controller
  • 手风琴 Accordion
  • 头像 Avatar
  • 徽标 Badge
  • 卡片 Card
  • 轮播 Carousel
  • 聊天气泡 Chat
  • 折叠面板 Collapse
  • 倒计时 Countdown
  • 描述列表 Descriptions
  • 对比 Diff
  • 二维码 QRCode
  • 悬浮 3D 卡片 Hover 3D
  • 悬浮画廊 Hover Gallery
  • 键盘提示 Kbd
  • 列表 List
  • 统计 Stat
  • 状态 Status
  • 表格 Table
  • 文本轮播 Text Rotate
  • 时间线 Timeline
  • 锚点 Anchor
  • 固钉 Affix
  • 面包屑 Breadcrumbs
  • 底部导航 Dock
  • 链接 Link
  • 菜单 Menu
  • 导航栏 Navbar
  • 分页 Pagination
  • 步骤 Steps
  • 选项卡 Tabs
  • 提示 Alert
  • 结果页 Result
  • 空状态 Empty
  • 加载 Loading
  • 全局提示 Message
  • 进度条 Progress
  • 环形进度 Radial Progress
  • 骨架屏 Skeleton
  • 通知提醒框 Notification
  • 轻提示 Toast
  • 气泡确认框 Popconfirm
  • 气泡卡片 Popover
  • 工具提示 Tooltip
  • 日历 Calendar
  • 颜色选择器 ColorPicker
  • 复选框 Checkbox
  • 字段集 Fieldset
  • 表单 Form
  • 文件输入 File Input
  • 筛选器 Filter
  • 标签 Label
  • 单选框 Radio
  • 范围选择 Range
  • 评分 Rating
  • 分段选择 Segmented
  • 自动完成 AutoComplete
  • 选择器 Select
  • 树选择 TreeSelect
  • 树控件 Tree
  • 提及输入 Mentions
  • 穿梭框 Transfer
  • 漫游引导 Tour
  • 输入框 Input
  • 数字输入 InputNumber
  • 文本域 Textarea
  • 开关 Toggle
  • 校验器 Validator
  • 分隔线 Divider
  • 弹性布局 Flex
  • 分割面板 Splitter
  • 抽屉侧边栏 Drawer
  • 页脚 Footer
  • 栅格 Grid
  • 瀑布流 Masonry
  • 布局 Layout
  • 主视觉区 Hero
  • 指示器 Indicator
  • 组合项 Join
  • 蒙版 Mask
  • 水印 Watermark
  • 间距 Space
  • 堆叠 Stack
  • 浏览器样机 Mockup Browser
  • 代码样机 Mockup Code
  • 手机样机 Mockup Phone
  • 窗口样机 Mockup Window

Collapse 折叠面板

使用 Rue 基础基于 daisyUI 的视觉语言,并在此基础上补充 `items`、accordion、 `activeKey`、`extra`、`description`、尺寸与图标位置等增强能力。

语义 API

优先面向 `items` 数据驱动用法,组织方式贴近常见业务组件,但使用 Rue 视觉风格。

# Items 基础用法

直接通过 items 渲染多项折叠面板,并默认使用带边框的分组容器。

Overview
汇总版本亮点、上线范围与回滚策略,适合用作页面最上方的信息概览。
Release Checklist
确认灰度开关、日志埋点、告警阈值与发布窗口已经准备完毕。
FAQ
常见问题、风险提示和升级说明也可以继续放进同一个折叠组。

# Accordion

使用 accordion 改成一次只展开一项,并结合受控 key 管理当前面板。

Migration Guide
梳理 breaking changes、默认行为差异与升级建议。
API Delta
列出属性变化与使用策略。
QA Notes
补充测试范围、回归清单和已知限制。

# 描述与额外操作

每一项可带 description、extra 和独立禁用状态,extra 区域点击不会触发展开。

Ops Console
控制发布节奏、灰度范围与告警阈值。
Beta
适合放置运维策略、SLA 约束和异常回滚说明。
Billing Center
当前模块仍在整理,暂不开放编辑。
Read only
禁用项会保持信息展示,但不响应交互。

# 图标位置与触发区域

支持把图标放在左侧,并限制只有图标本身可触发开合。

Deployment Window
只有左侧图标可点击,标题区更适合放长文本说明。
当标题里还有链接、状态或操作说明时,这个模式会更稳妥。
Security Review
保持默认 header 触发,图标只是视觉反馈。
适合和 icon-only 模式混合使用。

# Ghost 与无边框

不想用分组边框时,可以关闭 bordered,再按需开启 ghost。

Design Tokens
透明背景更适合嵌在卡片、侧栏或深色容器中。
Theme Sync
可继续叠加自定义类名,让容器完全交给外层布局控制。

# 尺寸与受控多开

size 会统一影响标题和内容尺寸;非 accordion 模式可同时展开多项。

Release Plan
大尺寸适合在信息层级较重的管理页或文档页中使用。
Release Notes
多开模式下可以把相邻的几块信息一起展开对照查看。
Rollback
受控模式更方便和 URL、筛选器或外部按钮联动。

# Collapse with focus

聚焦时展开、失焦时关闭,同时也支持重复点击标题切换开合。

How do I create an account?
Click the "Sign Up" button in the top right corner and follow the registration process.

# Collapse with checkbox

使用复选框控制展开与关闭,并支持重复点击标题切换。

How do I create an account?
Click the "Sign Up" button in the top right corner and follow the registration process.

# Collapse using details and summary tag

使用 details/summary 标签。

How do I create an account?
Click the "Sign Up" button in the top right corner and follow the registration process.

# Without border and background color

How do I create an account?
Click the "Sign Up" button in the top right corner and follow the registration process.

# With arrow icon

How do I create an account?
Click the "Sign Up" button in the top right corner and follow the registration process.

# With plus/minus icon

How do I create an account?
Click the "Sign Up" button in the top right corner and follow the registration process.

# Moving collapse icon to the start

通过 utility 类移动图标位置,并保持标题区重复点击切换能力。

How do I create an account?
Click the "Sign Up" button in the top right corner and follow the registration process.

# Force open

I have collapse-open class
Click the "Sign Up" button in the top right corner and follow the registration process.

# Force close

I have collapse-close class
Click the "Sign Up" button in the top right corner and follow the registration process.

# Custom colors for collapse that works with focus

通过 focus 触发颜色变化。

How do I create an account?
Click the "Sign Up" button in the top right corner and follow the registration process.

# Custom colors for collapse that works with checkbox

通过 peer/peer-checked 触发颜色变化,并支持重复点击标题切换。

How do I create an account?
Click the "Sign Up" button in the top right corner and follow the registration process.

API

Collapse

属性说明类型默认值
items数据驱动的折叠面板列表CollapseItem[]-
activeKey受控展开项;accordion 模式下可传单值string | number | Array<string | number>-
defaultActiveKey非受控默认展开项string | number | Array<string | number>-
accordion是否只允许同时展开一项booleanfalse
bordered是否使用分组边框容器booleanitems 模式默认 true
ghost是否使用透明背景booleanfalse
size标题与内容尺寸'sm' | 'md' | 'lg''md'
expandIconPlacement展开图标位置'start' | 'end''end'
onChangeitems 模式切换时触发,返回下一个展开 key(nextValue, context) => void-
tag支持基础写法的根标签切换'div' | 'details''div'

CollapseItem

属性说明类型默认值
key面板唯一标识string | number索引值
label标题内容,支持 title 别名any-
children面板内容,支持 content 别名any-
description标题下方的说明文案any-
extra标题右侧附加区域,不触发展开any-
showArrow是否显示展开图标boolean继承父级
collapsible触发区域控制'header' | 'icon' | 'disabled''header'
disabled禁用当前项交互booleanfalse
open非受控初始展开booleanfalse
页内导航
页内导航
文档
  • 深度指南
  • 实战例子
  • 快速上手
  • 术语表
  • 错误码参照表
关于
  • 常见问题
  • 团队
  • 版本发布
  • 社区指南
生态
  • 插件
  • 组件库
  • 路由指南
  • Text.js
© 2024-2026 Xiangmin Liu
Rue.JS