---
url: /components/input.md
---
# Input 输入框

`EvInput` 是前台内容提交的基础件：评论昵称、搜索词、邮箱订阅、资料填写都从这里出发。
支持前缀图标、一键清空、错误态与三档尺寸；`type` 直接透传（email / search / password…）。

## 基础用法

```vue
<EvInput v-model="name" placeholder="怎么称呼你" />
<EvInput v-model="mail" type="email" icon="mail" placeholder="you@example.com" />
<EvInput v-model="find" type="search" icon="search" placeholder="搜索…" clearable />
```

## 状态与尺寸

```vue
<EvInput model-value="格式有误的内容" error />
<EvInput size="large" placeholder="large" />
```

## API

### Props

| 属性 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| v-model | 输入值 | string / number | `''` |
| type | 原生类型 | string | `'text'` |
| placeholder | 占位文案 | string | — |
| icon | 前缀图标名 | string | — |
| clearable | 展示清空按钮 | boolean | `false` |
| disabled | 禁用 | boolean | `false` |
| error | 错误态 | boolean | `false` |
| size | 尺寸 | `'small' \| 'default' \| 'large'` | `'default'` |

其余 attrs（`maxlength` 等）直接透传到原生 input。

### 事件

| 事件 | 说明 | 参数 |
| --- | --- | --- |
| update:modelValue | 输入时派发 | value |
| clear | 点击清空按钮 | — |
