Autocomplete input box

Updated at:

Introduction

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

image

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

autoComplete.value

The current input content.

labelText

string

autoComplete.labelText

The text of the label.

placeholder

string

autoComplete.placeholder

The placeholder content.

disabled

boolean

autoComplete.disabled

Indicates whether the component is disabled.

options

array

autoComplete.options

The data source for the component.

hidden

boolean

autoComplete.hidden

Indicates whether the component is hidden.

validationStatus

boolean

autoComplete.validationStatus

The validation status of the component.

validationMessage

string

autoComplete.validationMessage

The validation message of the component.

blur

func

autoComplete.blur()

The component loses focus

focus

func

autoComplete.focus()

Makes the component gain focus.

validate

func

autoComplete.validate()

Validates the component.

setValue

func

autoComplete.setValue('')

Sets the content of the component.

setDisabled

func

autoComplete.setDisabled(true)

Sets the disabled state of the component.

setHidden

func

autoComplete.setHidden(true)

Sets the hidden state of the component.

clearValue

func

autoComplete.clearValue()

Clears the value of the component.

clearHidden

func

autoComplete.clearHidden()

Clears the hidden state of the component.

clearValidate

func

autoComplete.clearValidate()

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.