0.0.5 • Published 3 years ago

vue-virtual-picklist v0.0.5

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

Vue Virtual Picklist

It is a picklist that virtualizes its options to avoid mounting all of them in the DOM. Options are swaped depending on the position of the scrollbar.

Here you can find the documentation which has lots of examples.

Props

Prop nameDescriptionTypeValuesDefault
caseInsensitiveIf enabled, the search is Case Insensitive.boolean-false
disabledif enabled, the picklist is disabled.boolean-false
enableSearchIf enabled, an input is rendered and the user can type on it.boolean-false
hideSelectedIf enabled, the selected option is removed from the available options.boolean-false
noOptionsAvailableTextIt is the text shown when the search returns no options.string-"no options found"
optionHeightIt determines the Height of each option. It is not necessary to set it. It is used by vue-virtualized-list to control the virtualization.number-30
optionsThese are the options available to be selected. Each object in the array must have the "value" and "label" keys. These objects can also have other keys, which will also be emited by the input and select events.array-
placeholderIt is the placeholder for when there are options to select but none were picked.string-"select an option"
searchInputPlaceholderIt is the placeholder for the search input. It has to be combined with the enable-search property.string-"type to filter available options"
searchKeyIt is the key used to filter the objects you passed on options property. It defaults to value, but you can choose other key from the objects you passed.string-"value"
valueStores the object which is used to determine the selected option. This object must be in the following format: { "value" : "a", "label" : "a", "index": 0 }object-
visibleOptionsIt controls the number of visible options.number-5

Events

Event namePropertiesDescription
show-optionsdispatched when options are hidden.
selectoption object - object containing value, label, index, and originalListIndexdispatched after selecting an option. This can be used when you use value, instead of v-model.
inputoption object - object containing value, label, index, and originalListIndexdispatched after selecting an option. This is used for v-model.

Slots

NameDescriptionBindings
selected-optionused to control how the selected option is rendered.option object - it contains value, label, index, and originalListIndex
placeholderused to control how the picklist's placeholder is rendered.
dropdown-iconused to override the dropdown icon. It can be any image and you can style it on the parent component.
optionused to control how each option from the list of options is rendered.option object - it is an object containing value, label, index, and originalListIndex
no-optionsused to control how the message when the filter returns 0 results is displayed.text string - it has the value you passed on the noOptionsAvailableText property