String to show when pointing to an option Name attribute to match optional label element Selects the first option if initial value is empty If set to true, will preserve the search query when opening/closing the component. Useful for async filtering, where we search through more complex data. Name of the property containing the group labelĪllow to select all group values by selecting the group labelĪrray of keyboard key aliases to block when selectingĭecide whether to filter the results internally based on search query. Name of the property containing the group values Limits the options displayed in the dropdown to the first X options. Changing to 'bottom' will revert this behaviour and will proritize the search results String to show when highlighting a potential tagīy default new tags will appear above the search results. Reset this.value, arch, lected after this.value changes.Įnable/disable closing after selecting an option Use only when multiple is true.Įquivalent to the placeholder attribute on a input.Īllows to remove all selected values. Label from option Object, that will be visible in the dropdown.Ĭlear the search input after select(). If array of objects, visible label will default to option.label.Įquivalent to the multiple attribute on a input. Used to identify the component in events.Īrray of available options: Objects, Strings or Integers. Changing the tag positon to 'bottom' will revert this behaviour and will prioritize the search results.
UNPKG VUE CDN CODE
In this example, the addTag method generates an object with a unique code property. Remember that when working with objects as options, you have to transform the received tag string to an object that matches the objects structure of the options list. The event handler should add the received tag to both the options list and the value. Selecting this temporary option will emit the event with the current typed search query as the first param. This will add an additional option at the beginning of the options list whenever you type a phrase that doesn’t have an exact match in the available options. To add tagging functionality to single/multiple selects, set the :taggable prop to true. By default the multiselect will open whereever there is more space once there is not enough space below to open at maxHeight. open-direction="bottom" – forces the multiselect to always open below.Useful for identification which component instance triggered the method (in loops for example). id="ajax" – every event is emitted with this as the second param.:options-limit="300" – limits the displayed options to 300.:limit-text="limitText" – function that receives the current selected options count and should return a string to show when the :limit count is exceed.:limit="3" – limits the visible results to 3.
UNPKG VUE CDN UPDATE
If you do that, you have to manually update the available :options. :internal-search="false" – disables the multiselect’s internal search engine.:hide-selected="true" – already selected options will not be displayed in the dropdown.Look at the provided asyncFind method for an example usage. It is convenient to set the :loading prop to true, whenever a request is in progress. It receives the searchQuery as the first param, which can be used to make an asynchronous API call. To react to the search query changes, set a handler function on the event. Vue-Multiselect supports changing the option list on the fly, thus can be also used a type-a-head search box.