Editable input box

Updated at:

Introduction

The editable input box component has an edit state and a non-edit state. In the edit state, users can modify the content.

image

Configuration items

Category

Configuration

Example

Description

Content

Default value

The default value of the component.

Placeholder content

The placeholder content.

Label

The form label. For more information, see Common form properties.

Tooltip

Set the tooltip content, background color, position, and trigger method.

Extension configuration

Settings for the component's prefix text, prefix icon, suffix text, suffix icon, and edit icon.

Interaction

Hidden

Hides the component. For more information, see Common properties.

Click to enter edit state

If enabled, click the component to enter the edit state.

Validation

Form validation. For more information, see Common form properties.

Style

Margin

The margin. For more information, see Common properties.

Clear button

Specifies whether to show the clear button.

CSS style

Text state content color

The color of the content in the text state.

Text state hover background color

The background color of the content when you hover over it in the text state.

Font size

The font size of the text.

Label font size

The font size of the label.

Properties and methods

Name

Type

Example

Description

value

string

editText.value

The current input content.

labelText

string

editText.labelText

The label text.

placeholder

string

editText.placeholder

The placeholder content.

editable

boolean

editText.editable

Specifies whether the component can be clicked to enter the edit state.

editing

boolean

editText.editing

Specifies whether the component is in the edit state.

hidden

boolean

editText.hidden

Specifies whether the component is hidden.

validationStatus

boolean

editText.validationStatus

The validation status of the component.

validationMessage

string

editText.validationMessage

The validation message of the component.

blur

func

editText.blur()

Removes focus from the component.

focus

func

editText.focus()

Sets focus on the component.

validate

func

editText.validate()

Component Validation

setValue

func

editText.setValue('')

Sets the content of the component.

setEditing

func

editText.setEditing(true)

Sets the edit state of the component.

setHidden

func

editText.setHidden(true)

Sets the hidden state of the component.

clearValue

func

editText.clearValue()

Clears the `value` of the component.

clearHidden

func

editText.clearHidden()

Clears the `hidden` value of the component.

clearValidate

func

editText.clearValidate()

Clears the validation information of the component.

Event callbacks

Configuration

Description

The event triggered after the component's value changes.

The event triggered after the component gains focus.

The event triggered after the component loses focus.