# List

The List component allows you to render an indefinetely long list of items. Under the hood List uses InifiniteScroll. This means that much of what applies to InifiniteScroll also applies to List. You can think of List´ as a high–level version ofInifiniteScroll`.

# Props

# keyField

Type: String

Default: id

id – by default each of your item must have a property called id. You can change this by setting the value of this prop to something else.

Name of property that uniquely identifies an item.

# selectionMode

Type: Function

A Function that tells CList how to handle selections. Please refer to the CList documentation to find out how to actually implement a custom selection mode.

Default: not specified

NoneSelectionMode – by default selecting an item does nothing. @vue-cdk/list exports more selection modes. Please refer to the List guide to see how that is done.

Selection mode of the List. The value of this prop determines how CList reacts to the user selecting items.

# minItemSize

Type: Number

Default: 30

Minimal size of the items. Will be passed onto DynamicScroller.

# items

Type: Array

Default: []

Items to be rendered by the virtualized list. Each item must have a unique identifier. You can specify the name of the identifying property by using the keyField-prop.

# loadMore

Type: Function

Default: not specified

Function to be called when the list needs more items from you. This function is called with a callback parameter that you MUST call at some point with additional items.

# Slots

# before

# default scoped

# loading

# Methods

# selected

Whether or not a given item is selected.

Arguments:

  • item an item managed by this list

# select

Select a given item. It depends on the current selection mode whether or not the item will actually be selected after this method has been executed.

Arguments:

  • item an item managed by this list

# scrollToIndex

Scrolls the list to the item at index.

Arguments:

  • index The row index of the item you want to scroll to.
Playground