accordion 折叠面板
基本用法
使用 accordion 对相似的内容进行分组和隐藏。内容放置于 XML 中内部的 accordionPanel 元素。accordionPanel 元素可以有多个,但是在同一时间只能有一个展开面板。
|
如需在 Jmix Studio 中添加 |
下面的示例展示了带三个面板的 accordion 组件:
<accordion id="accordion">
<accordionPanel summaryText="Stamford">
<div text="Stamford is a town in the South Kesteven District of Lincolnshire, England."/>
</accordionPanel>
<accordionPanel summaryText="Boston">
<div text="Boston is the capital and largest city of the American Northeast."/>
</accordionPanel>
<accordionPanel summaryText="London">
<div text="London is the capital and largest city of England and the United Kingdom." />
</accordionPanel>
</accordion>
每个 accordionPanel 都有一个标题,以及一个可以放置其他组件的内容区域。当面板折叠时,标题仍然可见。与 tabSheet 标签面板 不同,折叠面板支持长标题。
样式版本
使用 themeNames 设置组件的样式。
| 样式 | 描述 | 支持的主题 |
|---|---|---|
|
面板使用填充背景样式。 |
Aura, Lumo |
|
在文本后面显示开关图标。 |
Aura, Lumo |
|
面板较小。 |
Aura, Lumo |
|
移除内容区域的默认内边距。 |
Aura |
XML 属性
下面是 accordion 和 accordionPanel 元素的 XML 属性:
accordionPanel
id - classNames - colspan - css - enabled - height - maxHeight - maxWidth - minHeight - minWidth - opened - summaryText - themeNames - visible - width
事件和处理器
对于 accordion 和 accordionPanel,处理器相同。
|
在 Jmix Studio 生成处理器桩代码时,可以使用 Jmix UI 组件面板的 Handlers 标签页或者视图类顶部面板的 Generate Handler 添加,也可以通过 Code → Generate 菜单(Alt+Insert / Cmd+N)生成。 |