Skip to content

Collapse ​

Collapse component enhanced based on Element Plus Collapse.

Use Collapse to store contents.

Basic usage ​

You can expand multiple panels

Consistency
Consistent with real life: in line with the process and logic of real life, and comply with languages and habits that the users are used to;
Consistent within interface: all elements should be consistent, such as: design style, icons and texts, position of elements, etc.

Accordion ​

In accordion mode, only one panel can be expanded at once

Activate accordion mode using the accordion attribute.

Consistency
Consistent with real life: in line with the process and logic of real life, and comply with languages and habits that the users are used to;
Consistent within interface: all elements should be consistent, such as: design style, icons and texts, position of elements, etc.

Custom title ​

Besides using the title attribute, you can customize panel title with named slots, which makes adding custom content, e.g. icons, possible.

TIP

The title slot provides an isActive property that indicates whether the current collapse item is active.

Custom icon ​

Besides using the icon attribute, you can customize icon of panel item with named slots, which makes adding custom content.

Consistency
Consistent with real life: in line with the process and logic of real life, and comply with languages and habits that the users are used to;
Consistent within interface: all elements should be consistent, such as: design style, icons and texts, position of elements, etc.

Custom icon position ​

using the expand-icon-position attribute, you can customize icon position.

expand icon position:
left

Prevent collapsing ​

set the before-collapse property, If false is returned or a Promise is returned and then is rejected, will stop collapsing.

before collapse return:
true
Consistency
Consistent with real life: in line with the process and logic of real life, and comply with languages and habits that the users are used to;
Consistent within interface: all elements should be consistent, such as: design style, icons and texts, position of elements, etc.

Toolbar ​

Customize the collapse item toolbar.

Use show-export attribute to display built-in action buttons, or use the toolbar slot to fully customize the toolbar content.

Data

Collapse API ​

Collapse Attributes ​

Element Plus Collapse Attributes
NameDescriptionTypeDefault
model-value / v-modelcurrently active panel, the type is string in accordion mode, otherwise it is arraystring / array[]
accordionwhether to activate accordion modebooleanfalse
expand-icon-positionset expand icon positionenumright
before-collapsebefore-collapse hook before the collapse state changes. If false is returned or a Promise is returned and then is rejected, will stop collapsingFunction—

Collapse Events ​

Element Plus Collapse Events
NameDescriptionType
changetriggers when active panels change, the parameter type is string in accordion mode, otherwise it is arrayFunction

Collapse Slots ​

Element Plus Collapse Slots
NameDescriptionSubtags
defaultcustomize default contentCollapse Item

Collapse Exposes ​

Element Plus Collapse Exposes
NameDescriptionType
activeNamescurrently active panel namesobject
setActiveNamesset active panel namesFunction

Collapse Item API ​

Collapse Item Attributes ​

NameDescriptionTypeDefault
title extendedtitle of the panelstring''
subtitlesubtitle of the panelstring''
icon extendedicon of the collapse itemstring / ComponentArrowRight
showExportshow export button, If onExport is empty, it will default to obtaining the export of the child component bk-table.booleanfalse
onExportexport eventFunction—
Element Plus CollapseItem Attributes
NameDescriptionTypeDefault
nameunique identification of the panelstring / number—
disableddisable the collapse itembooleanfalse

Collapse Item Slot ​

NameDescriptionType
title extendedcontent of Collapse Item titleobject
icon extendedcontent of Collapse Item iconobject
toolbarcontent of Collapse Item toolbar—
Element Plus CollapseItem Slot
NameDescriptionType
defaultcontent of Collapse Item—

Collapse Item Exposes ​

Element Plus CollapseItem Exposes
NameDescriptionType
isActivewhether the current collapse item is activeobject

Released under the MIT License.