跳到正文Skip to content

输入框Text Field FieldInput

输入框 / 文本域 / 下拉三态合一Input, textarea and select in one component

表单Form Vue 组件Vue component

实时示例Live example

活体样例,可直接交互(点开浮层 / 下拉 / 试试键盘)——与组件画廊同源,切主题会同步。Interactive sample straight from the gallery (open overlays, dropdowns, try the keyboard); the theme stays in sync. 新标签打开 ↗Open in new tab ↗ · 看完整画廊Full gallery

PropsProps17

名称Name类型Type必填Required默认值Default说明Notes
modelValue string 否no ''
label string 否no —
type 'text' | 'email' | 'password' | 'search' | 'url' | 'number' | 'textarea' | 'select' 否no 'text'
id string 否no —
name string 否no —
required boolean 否no —
placeholder string 否no —
hint string 否no —
error string 否no —
mono boolean 否no —
rows number 否no 3
options FieldOption[] 否no —
autocomplete string 否no —
spellcheck boolean 否no true
disabled boolean 否no —
inputmode 'text' | 'numeric' | 'email' | 'url' 否no —
ariaLabel string 否no —

EventsEvents1

  • update:modelValue — v: string

SlotsSlots1

hint

Class 契约Class contract

照抄以下类名,不要自造——它们是本设计系统的唯一命名空间(anx- 前缀)。Copy these class names as-is — they are the system’s only namespace (anx- prefix).

anx-field anx-field__error anx-field__hint anx-field__label anx-input anx-input--mono anx-req anx-textarea

依赖Dependencies

Icon SelectMenu ui.types

源码Source

vue/ui/FieldInput.vue 在 GitHub 上查看View on GitHub ↗