Input
# FxInput
Due to different interaction methods between mobile and PC, there are many parameter variations. For mobile usage, please refer directly to the mobile section at the bottom.
For entering characters via mouse or keyboard.
:::warning Input is a controlled component that always displays the Vue bound value.
Normally, you should handle the input event and update the component's bound value (or use v-model). Otherwise, the displayed value in the input box won't change.
Does not support v-model modifiers.
:::
# Basic Usage
The default decimal places decimalPlaces is 2.
# Input Value Displayed as Tags
# Disabled State
# Clearable
# Password Box
# Input with Icon
Display input type with icon markers
# Textarea
For multi-line text input by setting type to textarea.
# Autosizing Textarea
Set autosize to make textarea height adjust automatically based on content. autosize can also accept an object specifying min/max rows.
# Composite Input
Add elements before or after, typically labels or buttons
# Sizes
# Input Suggestions
Show input suggestions based on input content
# Custom Template
Customize how suggestions are displayed
# Remote Search
Search data from server
# Input Length Limit
# Input Attributes
| Attribute | Description | Type | Options | Default |
|---|---|---|---|---|
| type | Input type | string | text, textarea and other native input types (opens new window) | text |
| value / v-model | Bound value. When collapse-tags is true, value is array | string / number/array | — | — |
| maxlength | Native attribute, max input length | number | — | — |
| minlength | Native attribute, min input length | number | — | — |
| show-word-limit | Whether to show word count, only works when type="text" or type="textarea" | boolean | — | false |
| placeholder | Input placeholder | string | — | — |
| clearable | Whether to show clear button | boolean | — | false |
| show-password | Whether to show password toggle icon | boolean | — | false |
| disabled | Whether to disable | boolean | — | false |
| size | Input size, doesn't work when type="textarea" | string | medium / small / mini | — |
| prefix-icon | Prefix icon class | string | — | — |
| suffix-icon | Suffix icon class | string | — | — |
| rows | Number of rows for textarea | number | — | 2 |
| autosize | Whether textarea has an adaptive height, can accept an object like { minRows: 2, maxRows: 6 } | boolean / object | — | false |
| autocomplete | Native attribute | string | on, off | off |
| auto-complete | Deprecated in next major version | string | on, off | off |
| name | Native attribute | string | — | — |
| readonly | Native attribute | boolean | — | false |
| max | Native attribute | — | — | — |
| min | Native attribute | — | — | — |
| step | Native attribute | — | — | — |
| resize | Control whether the input can be resized by user | string | none, both, horizontal, vertical | — |
| autofocus | Native attribute | boolean | true, false | false |
| form | Native attribute | string | — | — |
| label | Associated label text | string | — | — |
| tabindex | Input tabindex | string | - | - |
| validate-event | Whether to trigger validation when inputting | boolean | - | true |
| collapse-tags | Whether to display input values as tags (value should be array) | boolean | - | false |
| is-blur-fold | When collapse-tags is true, whether to fold after blur | boolean | - | true |
| validate-when-input | Trigger validation when inputting | boolean | - | true |
| validate-when-blur | Trigger validation when blurring | boolean | - | false |
# Input Slots
| Name | Description |
|---|---|
| prefix | Prepend content, only works when type="text" |
| suffix | Append content, only works when type="text" |
| prepend | Prepend content, only works when type="text" |
| append | Append content, only works when type="text" |
# Input Events
| Event Name | Description | Parameters |
|---|---|---|
| blur | Triggers when Input loses focus | (event: Event |