折叠面板

使用

Yes. It adheres to the WAI-ARIA design pattern.

::accordion{default-value="first-item" collapsible}
  ::accordion-item{value="first-item"}
  #title
  Is it accessible?

  #content
  Yes. It adheres to the WAI-ARIA design pattern.
  ::

::accordion-item
#title
Is it unstyled?

#content
Yes. It's unstyled by default, giving you freedom over the look and feel.
::
:accordion-item{title="Can it be animated?" content="Yes! You can use the transition prop to configure the animation."}
::

::accordion-item 中的 value 属性默认是自动生成的. 你可以将其设置为其他唯一值, 并将它们放在 ::accordiondefault-value 属性中.

属性

::accordion-item

type'single' | 'multiple'
'single'
collapsibleboolean
undefined
这些项目是否可以折叠
defaultValuestring | string[]
默认打开项

::accordion

valuestring
项的值
titlestring
项的标题
contentstring
项内容