Collapse

Use Collapse to store contents.

Basic usage

You can expand multiple panels

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.

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

Starting from version 2.9.10, the title slot provides an isActive property that indicates whether the current collapse item is active.

Custom icon 2.8.3

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

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 2.9.10

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

expand icon position:
left

Collapse API

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-position 2.9.10set expand icon positionenumright

Collapse Events

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

Collapse Slots

NameDescriptionSubtags
defaultcustomize default contentCollapse Item

Collapse Exposes

NameDescriptionType
activeNamescurrently active panel namesobject
setActiveNamesset active panel namesFunction

Collapse Item API

Collapse Item Attributes

NameDescriptionTypeDefault
nameunique identification of the panelstring / number
titletitle of the panelstring''
icon 2.8.3icon of the collapse itemstring / ComponentArrowRight
disableddisable the collapse itembooleanfalse

Collapse Item Slot

NameDescriptionType
defaultcontent of Collapse Item
titlecontent of Collapse Item titleobject
icon 2.8.3content of Collapse Item iconobject

Collapse Item Exposes

NameDescriptionType
isActivewhether the current collapse item is activeobject

Source

ComponentStyleDocs

Contributors