Props
A list with all available props that the vSelect component accepts.
These are the available props. The vSelect component does not inherit attributes and all additional attributes are directly passed to the internal input element and can be used for further altering the behavior of the component like: disabled
, readonly
, pattern
, required
, autofocus
. The fetching function won't be called unless the input is :valid
By default the component will try to fetch the options list even if there is no query. If the query is required you may pass the required
or the minlength
attribute. The latter is recommended to avoid form HTML5 validation issues when the input is empty.
Prop | Default | Type | Description |
value | Any | Enables | |
stateful |
| Boolean | By default the component relies on |
query | String | Sets the query string in the input. Supports | |
from |
| Array | Feed with options for the dropdown list |
Function | Function that returns the list array. Can be | ||
String | URL that will be used for fetching the list via AJAX. See fetch prop. | ||
as |
| String | Required when working with non primitive values (objects) to specify a Example: Notice: In the last example value path was skipped (empty string) resulting in the whole object being assigned to the model. |
Array(String) | An array of paths to label, value and index properties. Check VSelectOption for more details. | ||
fetch |
| Function |
Examples:
|
parse | String | Path to property of the fetch response that contains the list array. | |
Function | Function that returns the list array from the fetch response. | ||
filter | auto | Boolean | Force enable / disable list filtering. By default filtering is enabled when from is considered static, i.e:
|
Function ( VSelectOption, query ) | Custom function to filter the list against query. Notice: If provided it will force enable filtering and will override filterBy | ||
filterBy |
| Function | This is the default filtering function when filter prop is |
tagging |
| Boolean | Enable / disable tagging. When enabled for a list with non primitive values label path must be specified in the as prop. |
Function | Enable / disable tagging based on function returned value. Should return | ||
tag-keys |
| Array(int) | Key codes that will trigger tagging. Enter key is always a tagging key and should not be listed! Example:
|
tags | Array(VSelectOption) | Use with | |
multiple | auto | Boolean | Force enable / disable multiple selection. By default it's true when |
debounce | 250 | Number | Time in milliseconds to wait after typing before executing the fetching function for dynamic lists. |
closeOnSelect | auto | Boolean | |
clearOnSelect | auto | Boolean | |
clearOnClose | auto | Boolean | |
find | Function/false | Function that receives and array of incomplete vSelectOptions and should return an array of options that can be used to complete them. The default function simply uses the |
Last updated