InputSelectMultiple.vue component is a multi-select input field with advanced features such as searching, toggles for selection, and customizable controls. It allows users to select multiple options from a given list and provides flexibility for handling various use cases.
Features
Multi-Select Support
Select multiple options simultaneously, enhancing flexibility for various use cases.
Searchable Options
Includes an optional search input for filtering options, allowing users to find selections quickly.
Toggles for Selection
Enables toggle-based selection, providing an alternative to the traditional dropdown.
Customizable Controls
Includes actions like “Select All” and “Clear All” to manage selections with ease.
Reactive Options
Dynamically updates selected values with
v-model, ensuring real-time synchronization.Usage
Basic Example
Props
boolean
default:"false"
Enables “Select All” and “Clear All” controls.
string | boolean
default:"''"
Error message to display below the input field.
string
default:"''"
Label text displayed above the input field.
string | boolean
default:"''"
Label text for an empty option.
boolean
default:"false"
Allows for a nullable (empty) option.
array | object
default:"[]"
The list of options available for selection.
boolean
default:"false"
Enables a search input for filtering options.
object
default:"undefined"
Defines the structure of options (
value and text keys).boolean
default:"false"
Enables toggle-based selection for options.
string
default:"'text'"
Specifies the input type.
array
default:"[]"
Two-way binding for the selected options.
number | string
default:"100"
Width of the input field as a percentage.
Example Use Cases
Disabled Input with Controls
Read-Only Input
Example with Search and Toggles
Example with Controls and Error Handling
Notes
- Reactive Options: The
v-modelbinding ensures the selected values are updated in real-time. - Search Functionality: Use the
searchprop to enable filtering options dynamically. - Control Actions: The
controlsprop adds “Select All” and “Clear All” buttons for enhanced usability.