Lista

Komponent
FList
Status
Produktionsklar
Innehåll

Lista används när användaren behöver gå igenom ett antal poster för att hitta en särskild post som ska visas eller hanteras.

Användning av komponent

Komponent motsvarar följande HTML element: Unordered List

API

Props
NameDescriptionTypeRequiredDefault

items

The items to be listed.
The items will be listed in the given array order.

ListArray

true

keyAttribute

Unique attribute in items.
V-for directive in vue requires a unique key to
be able to optimize reuse of components.

string

true

selectable

If true the list will be selectable.

boolean

false

false

checkbox

Only applies if selectable:true
Disable checkbox in interactive list and create a <a>-wrapper for each item, making them clickable

boolean

false

true

v-model

V-model will bind to value containing selected items.

ListArray | undefined

false

() => undefined

v-model:active

V-model will bind to value containing the current active item.

ListItem | undefined

false

() => undefined

elementId

Unique item id that will be used instead of the automatically generated one.

string

false

() => ElementIdService.generateElementId()

Events
NameDescriptionProperties

change

Emitted when item is activated, i.e. clicked

item: ListItem

click

Emitted when item is activated, i.e. clicked

item: ListItem

update

Vue2 v-model event to update value properity.

<anonymous>: undefined

unselect

Emitted when item is unselected.

item: ListItem
selectedItems: ListArray

update:modelValue

V-model event to update value property.

<anonymous>: undefined

select

Emitted when item is selected.

item: ListItem
selectedItems: ListArray

update:active

V-model active event.

activeItem: ListItem

Slots
NameDescriptionBindings

default

Slot for displaying an item.

item

empty

Slot for displaying a message when list is empty.

screenreader

Slot for screen reader text when checkbox (to selecte item) get focus.

item

Esc för att stänga Pil upp/ner för att navigera Enter för att välja