Input (输入框)
文本输入框(v-model),带标签、辅助 / 错误文本与尺寸。
基础用法
Helper text below the field.
Basic.vue
尺寸
Sizes.vue
状态
This field is required.
States.vue
可清除与密码
Clearable.vue
前后缀
带前缀图标
$
USD
带后缀单位
Affix.vue
属性
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| autofocus | boolean | false | Focus the field on mount. Focus is moved with `preventScroll`, so it never jogs the page: an autofocused input inside a popover is at the document origin until Floating UI has positioned it, and letting the browser scroll to it there threw the page to the top. |
| className | string | "" | |
| color | KunUIColor | "default" | |
| darkBorder | boolean | true | Legacy dark-mode border toggle. |
| description | string | "" | Helper text below the field (hidden when `error` is set). Canonical name. |
| disabled | boolean | false | |
| error | string | "" | |
| helperText | string | "" | Helper text below the field. |
| isClearable | boolean | false | Show an X button to clear the value when non-empty. |
| isInvalid | boolean | false | Mark the field invalid (danger ring) without showing an error message. |
| label | string | "" | |
| modelValue | string | number | "" | |
| placeholder | string | "" | |
| required | boolean | false | |
| revealPassword | boolean | false | For type="password": render an eye toggle to reveal/hide the value. |
| rounded | KunUIRounded | — | |
| size | KunUISize | "md" | |
| type | string | "text" |
事件
| 事件 | 回调参数 |
|---|---|
| blur | event: FocusEvent |
| clear | — |
| focus | event: FocusEvent |
| update:modelValue | value: string | number |
插槽
| 插槽 | 作用域 |
|---|---|
| #prefix | — |
| #suffix | — |