Autocomplete input box
Introduction
The autocomplete input box component provides suggestions and prompts to assist with user input.

Configuration items
Category |
Configuration |
Example |
Description |
Content |
Data Source |
Configure the data source manually or by mapping. Manual configuration lets you set each item directly. Mapping requires you to configure an array as the data source. Each item in the array must have `label`, `value`, and `disabled` properties. |
|
Default value |
The default value. |
||
Placeholder content |
The placeholder content. |
||
Label |
The form label. For more information, see Common form properties. |
||
Interaction |
Hide |
Hides the component. For more information, see Common properties. |
|
Disable |
Disables the component. |
||
Validation |
The form validation. For more information, see Common form properties. |
||
Style |
Margin |
The outer margin. For more information, see Common properties. |
|
Clear button |
Shows or hides the clear button. |
||
Variants |
The style variant of the component. Different variants support different CSS styles. |
||
CSS Style |
Border radius |
The border radius of the component. |
|
Option font size |
The font size for the dropdown options. |
||
Selection box background color |
The background color of the selection box. |
||
Option hover background color |
Component border color |
||
Label font size |
The font size of the component's label. |
Properties and methods
Name |
Type |
Example |
Description |
value |
string |
|
The current input content. |
labelText |
string |
|
The text of the label. |
placeholder |
string |
|
The placeholder content. |
disabled |
boolean |
|
Indicates whether the component is disabled. |
options |
array |
|
The data source for the component. |
hidden |
boolean |
|
Indicates whether the component is hidden. |
validationStatus |
boolean |
|
The validation status of the component. |
validationMessage |
string |
|
The validation message of the component. |
blur |
func |
|
The component loses focus |
focus |
func |
|
Makes the component gain focus. |
validate |
func |
|
Validates the component. |
setValue |
func |
|
Sets the content of the component. |
setDisabled |
func |
|
Sets the disabled state of the component. |
setHidden |
func |
|
Sets the hidden state of the component. |
clearValue |
func |
|
Clears the value of the component. |
clearHidden |
func |
|
Clears the hidden state of the component. |
clearValidate |
func |
|
Clears the validation information of the component. |
Event callbacks
Configuration |
Description |
Triggered when the value of the component changes. |
|
Triggered when the component gains focus. |
|
Triggered when the component loses focus. |
|
Triggered when a search is initiated as the user types. |
|
Triggered when the user selects an item after searching with a keyword. |